NullPointerException in WordCounter.isStopWord #4

Closed
dbasch opened this Issue Aug 7, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@dbasch

dbasch commented Aug 7, 2012

I have a text file that produces this in the latest release as well as in trunk:

Exception in thread "Animation Thread" java.lang.NullPointerException
at wordcram.WordCounter.isStopWord(WordCounter.java:90)
at wordcram.WordCounter.shouldCountWord(WordCounter.java:76)
at wordcram.WordCounter.countWords(WordCounter.java:61)
at wordcram.WordCounter.count(WordCounter.java:54)
at wordcram.WordCram.getWordCramEngine(WordCram.java:726)
at wordcram.WordCram.drawAll(WordCram.java:773)
at twitterwords.setup(twitterwords.java:62)
at processing.core.PApplet.handleDraw(PApplet.java:1608)
at processing.core.PApplet.run(PApplet.java:1530)
at java.lang.Thread.run(Thread.java:680)

I was able to bypass this error with a check for null, although I don't know if this is your intended behavior.

private boolean isStopWord(String word) {
if (cueStopWords == null) return false;
return cueStopWords.isStopWord(word) ||
extraStopWords.contains(word.toLowerCase());
}

@danbernier

This comment has been minimized.

Show comment
Hide comment
@danbernier

danbernier Aug 7, 2012

Owner

Interesting. What does the text file look like?

Owner

danbernier commented Aug 7, 2012

Interesting. What does the text file look like?

@dbasch

This comment has been minimized.

Show comment
Hide comment
@danbernier

This comment has been minimized.

Show comment
Hide comment
@danbernier

danbernier Aug 19, 2012

Owner

This is fixed on master; I'll try to get a release out as soon as I can. Thanks for the find!

Owner

danbernier commented Aug 19, 2012

This is fixed on master; I'll try to get a release out as soon as I can. Thanks for the find!

@danbernier

This comment has been minimized.

Show comment
Hide comment
@danbernier

danbernier Aug 20, 2012

Owner

This fix is in the new release, 0.5.5:
http://wordcram.org/2012/08/19/wordcram-0-5-5-released/
On Aug 7, 2012 5:47 PM, "dbasch" notifications@github.com wrote:

Here it is:

https://gist.github.com/3289656


Reply to this email directly or view it on GitHubhttps://github.com/danbernier/WordCram/issues/4#issuecomment-7567969.

Owner

danbernier commented Aug 20, 2012

This fix is in the new release, 0.5.5:
http://wordcram.org/2012/08/19/wordcram-0-5-5-released/
On Aug 7, 2012 5:47 PM, "dbasch" notifications@github.com wrote:

Here it is:

https://gist.github.com/3289656


Reply to this email directly or view it on GitHubhttps://github.com/danbernier/WordCram/issues/4#issuecomment-7567969.

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