Author: kono
Date: 2012-03-09 15:27:01 -0800 (Fri, 09 Mar 2012)
New Revision: 28477
Modified:
cytoscape/trunk/application/src/main/java/cytoscape/visual/ui/editors/continuous/ContinuousMappingEditorPanel.java
Log:
fixed NPE problem when loading session files.
Modified:
cytoscape/trunk/application/src/main/java/cytoscape/visual/ui/editors/continuous/ContinuousMappingEditorPanel.java
===================================================================
---
cytoscape/trunk/application/src/main/java/cytoscape/visual/ui/editors/continuous/ContinuousMappingEditorPanel.java
2012-03-09 22:37:32 UTC (rev 28476)
+++
cytoscape/trunk/application/src/main/java/cytoscape/visual/ui/editors/continuous/ContinuousMappingEditorPanel.java
2012-03-09 23:27:01 UTC (rev 28477)
@@ -521,15 +521,17 @@
// Set range values
if (EditorValueRangeTracer.getTracer().getRange(type)
== 0) {
final CountedIterator it =
mhm.getObjectKeys(controllingAttrName);
- Object key;
double maxValue = Double.NEGATIVE_INFINITY;
double minValue = Double.POSITIVE_INFINITY;
while (it.hasNext()) {
final String id = (String)it.next();
final Object attrValue =
attrs.getAttribute(id, controllingAttrName);
-
+ if(attrValue == null)
+ continue;
+
final double val;
+
if (attrValue.getClass() ==
Double.class)
val = (Double)attrValue;
else if (attrValue.getClass() ==
Integer.class)
@@ -543,7 +545,6 @@
if (val < minValue)
minValue = val;
}
-
EditorValueRangeTracer.getTracer().setMax(type,
maxValue);
EditorValueRangeTracer.getTracer().setMin(type,
minValue);
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.