Author: jm
Date: 2011-02-07 11:57:22 -0800 (Mon, 07 Feb 2011)
New Revision: 24032

Modified:
   
core3/filter-impl/trunk/src/main/java/org/cytoscape/filter/internal/quickfind/util/QuickFindImpl.java
Log:
Fixed NullPointerExceptions in filter-impl

Modified: 
core3/filter-impl/trunk/src/main/java/org/cytoscape/filter/internal/quickfind/util/QuickFindImpl.java
===================================================================
--- 
core3/filter-impl/trunk/src/main/java/org/cytoscape/filter/internal/quickfind/util/QuickFindImpl.java
       2011-02-07 18:12:13 UTC (rev 24031)
+++ 
core3/filter-impl/trunk/src/main/java/org/cytoscape/filter/internal/quickfind/util/QuickFindImpl.java
       2011-02-07 19:57:22 UTC (rev 24032)
@@ -126,7 +126,13 @@
                }
 
                //  Create Appropriate Index Type, based on attribute type.
-               Class<?> attributeType = 
nodeTable.getColumn(controllingAttribute).getType();
+               CyColumn column = nodeTable.getColumn(controllingAttribute);
+               Class<?> attributeType;
+               if (column == null) {
+                       attributeType = String.class;
+               } else {
+                       attributeType = column.getType();
+               }
                GenericIndex index = createIndex(QuickFind.INDEX_NODES, 
attributeType, controllingAttribute);
                indexNetwork(network, QuickFind.INDEX_NODES, attributeType, 
controllingAttribute, index, taskMonitor);
                networkMap.put(network, index);
@@ -260,7 +266,13 @@
                } else {
                        //  Option 2:  Index single attribute.
                        //  Create appropriate index type, based on attribute 
type.
-                       Class<?> attributeType = 
table.getColumn(controllingAttribute).getType();
+                       CyColumn column = table.getColumn(controllingAttribute);
+                       Class<?> attributeType;
+                       if (column == null) {
+                               attributeType = String.class;
+                       } else {
+                               attributeType = column.getType();
+                       }
                        index = createIndex(indexType, attributeType, 
controllingAttribute);
                        indexNetwork(cyNetwork, indexType, attributeType, 
controllingAttribute, index, taskMonitor);
                }

-- 
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.

Reply via email to