From 0dba01948794efe6290a00a9d1dff3745f4be795 Mon Sep 17 00:00:00 2001 From: Sammy Jelin Date: Thu, 17 Mar 2016 22:08:06 -0700 Subject: [PATCH] fix(zonespec): Do not crash on error if last task had no data Closes #281 --- lib/zone-spec/long-stack-trace.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/zone-spec/long-stack-trace.ts b/lib/zone-spec/long-stack-trace.ts index fc1f56f39..c564d64e8 100644 --- a/lib/zone-spec/long-stack-trace.ts +++ b/lib/zone-spec/long-stack-trace.ts @@ -94,13 +94,14 @@ var value = descriptor.value; descriptor = { get: function() { - return renderLongStackTrace(parentTask.data[creationTrace], + return renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], delegateGet ? delegateGet.apply(this): value); } }; Object.defineProperty(error, 'stack', descriptor); } else { - error.stack = renderLongStackTrace(parentTask.data[creationTrace], error.stack); + error.stack = renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], + error.stack); } } return parentZoneDelegate.handleError(targetZone, error); @@ -130,4 +131,4 @@ } } computeIgnoreFrames(); -})(); \ No newline at end of file +})();