I read a file that contains words seperated by space into my wordcram program to generate word clouds. I constantly change the data in the file. It works fine for many files. But for some, I get this exception,
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 election_extractor.WordCloud_Generator.setup(WordCloud_Generator.java:74)
at processing.core.PApplet.handleDraw(PApplet.java:1402)
at processing.core.PApplet.run(PApplet.java:1327)
at java.lang.Thread.run(Thread.java:662)
and this is my code to generate word clouds,
public class WordCloud_Generator extends PApplet {