Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Console requires some null checking
  • Loading branch information
janjongboom committed May 11, 2012
1 parent a90a631 commit 0572f85
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugins-client/ext.console/console.js
Expand Up @@ -327,7 +327,11 @@ module.exports = ext.register("ext/console/console", {
break;
default:
if (message.type.match(/-start$/)) {
var command_id = extra.command_id;
var command_id = extra && extra.command_id;

if (!command_id) {
return;
}

this.tracerToPidMap[command_id] = message.pid;
this.pidToTracerMap[message.pid] = command_id;
Expand All @@ -340,8 +344,8 @@ module.exports = ext.register("ext/console/console", {

if (message.type.match(/-data$/)) {
var type = "tracer";
var id = extra.command_id;
if (!command_id) {
var id = extra && extra.command_id;
if (!id) {
type = "pid";
id = message.pid;
}
Expand All @@ -352,7 +356,7 @@ module.exports = ext.register("ext/console/console", {
}

if (message.type.match(/-exit$/)) {
if (extra.command_id)
if (extra && extra.command_id)
this.markProcessAsCompleted(extra.command_id);
else
this.markProcessAsCompleted(message.pid, true);
Expand Down

0 comments on commit 0572f85

Please sign in to comment.