mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 19:05:34 +01:00
tiny fix for a NPE when sketch.properties is there but lacks server.port in js mode
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user