From c9b40bbd74151f56218ccad5e5f4f6aff938cd4d Mon Sep 17 00:00:00 2001 From: Mayank Gautam Date: Tue, 18 Feb 2020 09:06:06 +0530 Subject: [PATCH] added undefined filePath check in the method resolvePathToFile --- server/utils/filePath.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/utils/filePath.js b/server/utils/filePath.js index 027b0e13..6a1ea673 100644 --- a/server/utils/filePath.js +++ b/server/utils/filePath.js @@ -1,4 +1,8 @@ export function resolvePathToFile(filePath, files) { + if (typeof filePath === 'undefined') { + return false; + } + const filePathArray = filePath.split('/'); let resolvedFile; let currentFile = files.find(file => file.name === 'root');