Skip to content

Commit

Permalink
Resolve UD-2799. Adding null checker in places.
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingbic committed Feb 22, 2024
1 parent 7d07f3e commit 289a1ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<groupId>org.cytoscape</groupId>
<artifactId>cx-support</artifactId>
<version>2.8.2</version>
<version>2.8.3</version>
<name>CX Support</name>
<description>CX JSON Reader and Writer for Cytoscape</description>
<packaging>bundle</packaging>
Expand All @@ -51,7 +51,7 @@
<extensions>true</extensions>
<configuration>
<source>11</source>
<target>11</target>
<target>17</target>
<encoding>UTF-8</encoding>
<optimize>true</optimize>
<showWarnings>true</showWarnings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ public void run(final TaskMonitor taskMonitor) throws FileNotFoundException, IOE
} else
exporter.writeNetwork(aspects, _os);
_os.close();
taskMonitor.setStatusMessage("Done.");
if(taskMonitor != null)
taskMonitor.setStatusMessage("Done.");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ private final static <T> void addMappings(final VisualStyle style,
}

if ( ! CxUtil.dataTypeIsValid(vp, type)) {
taskMonitor.showMessage(TaskMonitor.Level.WARN,
if ( taskMonitor != null)
taskMonitor.showMessage(TaskMonitor.Level.WARN,
"Pass through mapping for " + vp.getIdString() + " on column '" + col + "' is not valid. Ignoring it.");
return;
}
Expand Down Expand Up @@ -415,14 +416,16 @@ public static <T> VisualPropertyMapping getCX2Mapping(final VisualStyle style,
if (CxUtil.dataTypeIsValid(vp, type))
def.setAttributeType(ATTRIBUTE_DATA_TYPE.fromCxLabel(type));
else {
taskMonitor.showMessage(TaskMonitor.Level.WARN, "Pass through mapping for " + vp.getIdString()
if ( taskMonitor != null)
taskMonitor.showMessage(TaskMonitor.Level.WARN, "Pass through mapping for " + vp.getIdString()
+ " on column '" + col + "' is not valid. Ignoring it.");
return null;
}
}
}
catch (final IOException e) {
taskMonitor.showMessage(TaskMonitor.Level.WARN, "WARNING: problem with mapping/column '" + col
if (taskMonitor !=null)
taskMonitor.showMessage(TaskMonitor.Level.WARN, "WARNING: problem with mapping/column '" + col
+ "': column not present, ignoring corresponding passthrough mapping. " + e.getMessage());
return null;
}
Expand Down

0 comments on commit 289a1ca

Please sign in to comment.