Skip to content

Commit

Permalink
fix: dev admin check for null child (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip authored Mar 18, 2020
1 parent c5b2069 commit 9eb7259
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/xarc-app-dev/lib/dev-admin/admin-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ class AdminServer {
const info = this.getServer(name);
if (info._child) {
info._child.once("exit", (code, signal) => {
this._io.show(ck`<orange>${name} (PID: ${info._child.pid}) exited code ${code} ${signal ? "- signal " + signal : ""}</orange>`);
const signalText = signal ? `- signal ${signal}` : "";
this._io.show(
ck`<orange>${name} (PID: ${info._child.pid}) exited code ${code} ${signalText}</orange>`
);
info._child = undefined;
info._starting = false;
this._webpackDevRelay.setAppServer(null);
Expand Down Expand Up @@ -436,15 +439,17 @@ ${info.name} - assuming it started.</>`);
return;
}

info._child.removeListener("message", messageHandler);
if (info._child) {
info._child.removeListener("message", messageHandler);
}
this.watchServer(info.name);
defer.resolve();
};

const handleTimeout = () => {
startTimeout = undefined;
if (info._child) {
messageHandler({ name: "timeout" });
messageHandler({ name: "timeout", _child: info._child });
}
};

Expand Down

0 comments on commit 9eb7259

Please sign in to comment.