jooby run: throws nullpointerexception when application fails to start fix
@@ -441,6 +441,7 @@ public class Main {
Field reffld = appref.getDeclaredField("ref");
AtomicReference ref = (AtomicReference) reffld.get(null);
this.app = ref.get();
+ if (this.app != null) {
Method started = app.getClass().getMethod("isStarted");
Boolean success = (Boolean) started.invoke(this.app);
if (success) {
@@ -449,6 +450,7 @@ public class Main {
debug("not started: %s", alias);
System.exit(1);
}
+ }
} catch (Throwable ex) {
Throwable cause = ex;
if (ex instanceof InvocationTargetException) {
