From 7fa059a0106544076e75a04cd5c63f431723f791 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 20 Jan 2017 15:28:22 +0100 Subject: [PATCH] labels - paranoia check --- src/vs/base/common/labels.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/common/labels.ts b/src/vs/base/common/labels.ts index 1952bcf3aff..71ed33eb30b 100644 --- a/src/vs/base/common/labels.ts +++ b/src/vs/base/common/labels.ts @@ -103,7 +103,7 @@ export function shorten(paths: string[]): string[] { for (let otherPathIndex = 0; !match && otherPathIndex < paths.length; otherPathIndex++) { // suffix subpath treated specially as we consider no match 'x' and 'x/...' - if (otherPathIndex !== pathIndex && paths[otherPathIndex].indexOf(subpath) > -1) { + if (otherPathIndex !== pathIndex && paths[otherPathIndex] && paths[otherPathIndex].indexOf(subpath) > -1) { const isSubpathEnding: boolean = (start + subpathLength === segments.length); const isOtherPathEnding: boolean = endsWith(paths[otherPathIndex], subpath); -- GitLab