Author: scooter
Date: 2010-10-30 23:30:43 -0700 (Sat, 30 Oct 2010)
New Revision: 22671
Modified:
cytoscape/trunk/application/src/main/java/cytoscape/data/ImportHandler.java
Log:
Protect against an NPE when the web site doesn't provide a content-type.
Modified:
cytoscape/trunk/application/src/main/java/cytoscape/data/ImportHandler.java
===================================================================
--- cytoscape/trunk/application/src/main/java/cytoscape/data/ImportHandler.java
2010-10-30 23:55:31 UTC (rev 22670)
+++ cytoscape/trunk/application/src/main/java/cytoscape/data/ImportHandler.java
2010-10-31 06:30:43 UTC (rev 22671)
@@ -433,7 +433,9 @@
// if none of the extensions match, then use the the content
type as
// a suffix and create a temp file.
if (tmpFile == null) {
- String ct = "." +
extractExtensionFromContentType(conn.getContentType());
+ String contentType = conn.getContentType();
+ if (contentType == null) contentType = "";
+ String ct = "." +
extractExtensionFromContentType(contentType);
tmpFile = File.createTempFile("url.download.", ct, new
File(tmpDir));
}
--
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.