Author: challngr Date: Tue Aug 5 20:55:28 2014 New Revision: 1616000 URL: http://svn.apache.org/r1616000 Log: UIMA-3900 Fix NPE when machines data returns null node.
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/nodeviz/NodeViz.java Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/nodeviz/NodeViz.java URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/nodeviz/NodeViz.java?rev=1616000&r1=1615999&r2=1616000&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/nodeviz/NodeViz.java (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/server/nodeviz/NodeViz.java Tue Aug 5 20:55:28 2014 @@ -247,8 +247,15 @@ public class NodeViz s = strip(s); if ( ! hosts.containsKey(s) ) { // System.out.println("Set host from MachineInfo with key :" + s + ":"); - VisualizedHost vh = new VisualizedHost(m.get(s), quantum); - hosts.put(s, vh); + + // NOTE: the map changes all the time so the value may be gone. This situation + // will be fixed one day but for now just forget the node, it will show up + // next time we get here. + MachineInfo mi = m.get(s); + if ( mi != null ) { + VisualizedHost vh = new VisualizedHost(mi, quantum); + hosts.put(s, vh); + } } }