Author: pwang
Date: 2011-10-27 16:49:55 -0700 (Thu, 27 Oct 2011)
New Revision: 27323

Modified:
   
csplugins/trunk/ucsd/ruschein/PanGIA-impl/src/main/java/org/idekerlab/PanGIAPlugin/ui/SearchPropertyPanel.java
Log:
Add null pointer check

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA-impl/src/main/java/org/idekerlab/PanGIAPlugin/ui/SearchPropertyPanel.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA-impl/src/main/java/org/idekerlab/PanGIAPlugin/ui/SearchPropertyPanel.java
      2011-10-27 23:41:53 UTC (rev 27322)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA-impl/src/main/java/org/idekerlab/PanGIAPlugin/ui/SearchPropertyPanel.java
      2011-10-27 23:49:55 UTC (rev 27323)
@@ -1523,29 +1523,36 @@
                
                
                String physicalSelected = 
physicalEdgeAttribComboBox.getSelectedItem().toString();
-               Class<?> attrType = 
this.physicalNetworkPanel.getSelectedNetwork().getDefaultEdgeTable().getColumn(physicalSelected).getType();
                
-               if 
(!physicalSelected.trim().equalsIgnoreCase(DEFAULT_ATTRIBUTE) && (attrType != 
Integer.class &&
-                            attrType != Double.class))
-               {
-                       searchButton.setEnabled(false);
-                       parameterErrorTextArea.setText("Please choose physical 
edge scores of type integer or float.");
-                       return;
+               if (this.physicalNetworkPanel.getSelectedNetwork() != null && 
+                               
this.physicalNetworkPanel.getSelectedNetwork().getDefaultEdgeTable().getColumn(physicalSelected)
 != null){
+                       Class<?> attrType = 
this.physicalNetworkPanel.getSelectedNetwork().getDefaultEdgeTable().getColumn(physicalSelected).getType();
+                       
+                       if 
(!physicalSelected.trim().equalsIgnoreCase(DEFAULT_ATTRIBUTE) && (attrType != 
Integer.class &&
+                                    attrType != Double.class))
+                       {
+                               searchButton.setEnabled(false);
+                               parameterErrorTextArea.setText("Please choose 
physical edge scores of type integer or float.");
+                               return;
+                       }                       
                }
                
                String geneticSelected = 
geneticEdgeAttribComboBox.getSelectedItem().toString();
                if (this.geneticNetworkPanel.getSelectedNetwork() != null &&
                                
this.geneticNetworkPanel.getSelectedNetwork().getDefaultEdgeTable().getColumn(geneticSelected)
 != null){
 
-                       Class<?> attrType2 = 
this.geneticNetworkPanel.getSelectedNetwork().getDefaultEdgeTable().getColumn(geneticSelected).getType();
-                       
-                       if 
(!geneticSelected.trim().equalsIgnoreCase(DEFAULT_ATTRIBUTE) && (attrType2 != 
Integer.class &&
-                                    attrType2 != Double.class))
-                       {
-                               searchButton.setEnabled(false);
-                               parameterErrorTextArea.setText("Please choose 
genetic edge scores of type integer or float.");
-                               return;
-                       }                       
+                       if (this.geneticNetworkPanel.getSelectedNetwork() != 
null &&
+                                       
this.geneticNetworkPanel.getSelectedNetwork().getDefaultEdgeTable().getColumn(geneticSelected)
 != null){
+                               Class<?> attrType2 = 
this.geneticNetworkPanel.getSelectedNetwork().getDefaultEdgeTable().getColumn(geneticSelected).getType();
+                               
+                               if 
(!geneticSelected.trim().equalsIgnoreCase(DEFAULT_ATTRIBUTE) && (attrType2 != 
Integer.class &&
+                                            attrType2 != Double.class))
+                               {
+                                       searchButton.setEnabled(false);
+                                       parameterErrorTextArea.setText("Please 
choose genetic edge scores of type integer or float.");
+                                       return;
+                               }                                               
        
+                       }
                }
                
                if ((annotationCheckBox.isSelected() || 
trainingCheckBox.isSelected()) && annotationAttribComboBox.getSelectedIndex()<0)

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