r78169 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78168‎ | r78169 | r78170 >
Date:10:45, 10 December 2010
Author:daniel
Status:deferred
Tags:
Comment:
fix NPE
Modified paths:
  • /trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/disambig/SlidingCoherenceDisambiguator.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/disambig/SlidingCoherenceDisambiguator.java
@@ -100,9 +100,11 @@
101101 if (initialWindow == 1) r = popularityDisambiguator.disambiguate(sequences, root, meanings, context);
102102 else r = super.disambiguate(sequences, root, meanings, context);
103103
104 - sequence.addAll(r.getSequence());
105 - currentNode = getLastNode(root, sequence);
106 - disambig.putAll(r.getMeanings());
 104+ if ( r != null ) {
 105+ sequence.addAll(r.getSequence());
 106+ currentNode = getLastNode(root, sequence);
 107+ disambig.putAll(r.getMeanings());
 108+ }
107109 }
108110
109111 while (true) {

Status & tagging log