Skip to content
Browse files

dragonfly: fix NPEs in simulator when not run with knapsack.

  • Loading branch information...
1 parent 58a6f01 commit eef4dfcafbd757777cf31623c407c566926a8ec1 @kgilmer kgilmer committed Aug 16, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 com.buglabs.bug.simulator/com/buglabs/bug/simulator/Activator.java
View
10 com.buglabs.bug.simulator/com/buglabs/bug/simulator/Activator.java
@@ -210,8 +210,10 @@ public void run(Map<String, Object> services) {
logService.log(LogService.LOG_ERROR, "BUG Simulator Controller unable to start. Another process is using it's port: " + BUG_SIMULATOR_CONTROLLER_PORT);
}
- shellThread = new ShellIOThread(Integer.parseInt(System.getProperty("org.knapsack.shell.port")));
- shellThread.start();
+ if (System.getProperty("org.knapsack.shell.port") != null) {
+ shellThread = new ShellIOThread(Integer.parseInt(System.getProperty("org.knapsack.shell.port")));
+ shellThread.start();
+ }
ShellButtonAdapter userBtn = new ShellButtonAdapter("user");
ShellButtonAdapter powerBtn = new ShellButtonAdapter("power");
@@ -247,7 +249,9 @@ public void stop(BundleContext context) throws Exception {
for (ServiceRegistration sr : btnServices)
sr.unregister();
- shellThread.shutdown();
+ if (shellThread != null) {
+ shellThread.shutdown();
+ }
if (controllerServer != null) {
controllerServer.shutdown();

0 comments on commit eef4dfc

Please sign in to comment.
Something went wrong with that request. Please try again.