From d861d8589cbbc50fc1920d154a9262d62e9d5695 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Tue, 16 Apr 2019 16:11:18 -0400 Subject: [PATCH] fix: Do not crash when nyc is run inside itself. Ref istanbuljs/nyc#1068 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 08ad9e2..93cbd9e 100644 --- a/index.js +++ b/index.js @@ -223,7 +223,7 @@ class ProcessDB { infos.forEach(info => { if (info.parent) { const parentInfo = infoByUid.get(info.parent) - if (parentInfo.children.indexOf(info.uuid) === -1) { + if (parentInfo && !parentInfo.children.includes(info.uuid)) { parentInfo.children.push(info.uuid) } }