Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 0dba019

Browse files
sjelinmhevery
authored andcommitted
fix(zonespec): Do not crash on error if last task had no data
Closes #281
1 parent 1787339 commit 0dba019

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/zone-spec/long-stack-trace.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,14 @@
9494
var value = descriptor.value;
9595
descriptor = {
9696
get: function() {
97-
return renderLongStackTrace(parentTask.data[creationTrace],
97+
return renderLongStackTrace(parentTask.data && parentTask.data[creationTrace],
9898
delegateGet ? delegateGet.apply(this): value);
9999
}
100100
};
101101
Object.defineProperty(error, 'stack', descriptor);
102102
} else {
103-
error.stack = renderLongStackTrace(parentTask.data[creationTrace], error.stack);
103+
error.stack = renderLongStackTrace(parentTask.data && parentTask.data[creationTrace],
104+
error.stack);
104105
}
105106
}
106107
return parentZoneDelegate.handleError(targetZone, error);
@@ -130,4 +131,4 @@
130131
}
131132
}
132133
computeIgnoreFrames();
133-
})();
134+
})();

0 commit comments

Comments
 (0)