Skip to content
Permalink
Browse files
fix(core): check if stack trace is available before reading it
affects: @serenity-js/core

ISSUES CLOSED: #84
  • Loading branch information
jan-molak committed Sep 24, 2017
1 parent 1e0b4b4 commit 0c871437bc3b49009e5d5578eb9f0719f1fbfc15
Showing with 1 addition and 1 deletion.
  1. +1 −1 packages/core/src/screenplay/actor.ts
@@ -147,7 +147,7 @@ class TrackedActivity implements Activity {
function locateCallerOf(method: string) {
const origin_of = (frames: StackFrame[]): number => frames.findIndex(frame => !! frame.functionName && !! ~frame.functionName.indexOf(method));
const get_frame = (frames: StackFrame[]): StackFrame => frames[origin_of(frames) + 1];
const frames_of_interest = (frame: StackFrame) => !~ frame.fileName.indexOf('node_modules');
const frames_of_interest = (frame: StackFrame) => frame && frame.fileName && !~ frame.fileName.indexOf('node_modules');
const to_location = (frame: StackFrame): SourceLocation => ({
path: frame.fileName,
line: frame.lineNumber,

0 comments on commit 0c87143

Please sign in to comment.