tiny fix for a NPE when sketch.properties is there but lacks server.port in js mode

This commit is contained in:
fjenett
2011-06-09 08:39:46 +00:00
parent c897ec039f
commit 32420d3870

View File

@@ -307,8 +307,12 @@ public class JavaScriptEditor extends Editor
if ( sketchProps.exists() ) {
try {
Settings props = new Settings(sketchProps);
int port = Integer.parseInt(props.get("server.port"));
jsServer.setPort(port);
String portString = props.get("server.port");
if ( portString != null && !portString.trim().equals("") )
{
int port = Integer.parseInt(portString);
jsServer.setPort(port);
}
} catch ( IOException ioe ) {
statusError(ioe);
}