Open GoogleCodeExporter opened 8 years ago
I was able to reproduce this error and trace the source to:
be.divijver.wikipedia.parser.wikitext.MarkupParser
The code at line 231 in the parseContentList() method should be changed from:
if (!characters.isEmpty()) {
contentList.add(new Characters(asString(characters)));
return (Content[])contentList.toArray(new Content[contentList.size()]);
} else {
return null;
}
to:
if (!characters.isEmpty())
contentList.add(new Characters(asString(characters)));
return (Content [])contentList.toArray(new Content[contentList.size()]);
Without this change it is possible to return NULL content and the
NullPointerException you discovered will result.
Original comment by bodhi.r...@gmail.com
on 11 Dec 2008 at 9:22
Actually, the following works better. (The first one inserts empty paragraphs
for
newlines)
if (!characters.isEmpty())
contentList.add(new Characters(asString(characters)));
if (contentList.size() > 0)
return (Content [])contentList.toArray(new Content[contentList.size()]);
else
return null;
Original comment by bodhi.r...@gmail.com
on 16 Dec 2008 at 7:05
Original issue reported on code.google.com by
dan80...@gmail.com
on 15 Mar 2008 at 4:52