diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index f452cd057a3e..8c91e62801d3 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -1782,7 +1782,7 @@ window.jstestdriver && (function(window) { try { injector.invoke(blockFns[i] || angular.noop, this); } catch (e) { - if(e.stack) e.stack += '\n' + errorForStack.stack; + if(e.stack && errorForStack) e.stack += '\n' + errorForStack.stack; throw e; } finally { errorForStack = null;