stop causing NPE when no keywords are present #5

Merged
merged 3 commits into from Oct 7, 2013

Projects

None yet

2 participants

@cap10morgan
Contributor

When there are no keywords present (I assume), (.getKeywords info) returns nil and calling (str/split nil ...) causes an NPE. This fixes that.

@KushalP
Owner
KushalP commented Oct 1, 2013

Tests are currently failing in Travis and there should really be a test for this. Any chance of fixing these please?

@cap10morgan
Contributor

Sorry about that. I copied and pasted code with a different namespace alias for clojure.string. Should be fixed now.

@KushalP
Owner
KushalP commented Oct 5, 2013

Can you add a test that shows how it fixes the NPE case please?

@cap10morgan
Contributor

Done. I had to add an example PDF file that demonstrates the original cause. It seems camelot is designed not to generate PDFs with nil keywords, but they do occur in the wild and PDFBox will sometimes hand us nil values from .getKeywords.

The file I added for this is resources/pdf/blank.pdf and is 6KB in size. Hopefully that's an acceptable approach.

@KushalP
Owner
KushalP commented Oct 7, 2013

Thanks! 👍

@KushalP KushalP merged commit 6fd0cae into KushalP:master Oct 7, 2013

1 check passed

default The Travis CI build passed
Details
@cap10morgan
Contributor

No problem. Can we get a point release soon with this fix? Thanks!

@KushalP
Owner
KushalP commented Oct 7, 2013

Sure. When I get home to my machine with my gpg key on I'll get a release sorted.

@cap10morgan
Contributor

Ping. :)

@KushalP
Owner
KushalP commented Feb 27, 2014

Just release v0.2.2.

@cap10morgan
Contributor

👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment