added undefined filePath check in the method resolvePathToFile

This commit is contained in:
Mayank Gautam 2020-02-18 09:06:06 +05:30 committed by Cassie Tarakajian
parent 8754848699
commit c9b40bbd74

View file

@ -1,4 +1,8 @@
export function resolvePathToFile(filePath, files) { export function resolvePathToFile(filePath, files) {
if (typeof filePath === 'undefined') {
return false;
}
const filePathArray = filePath.split('/'); const filePathArray = filePath.split('/');
let resolvedFile; let resolvedFile;
let currentFile = files.find(file => file.name === 'root'); let currentFile = files.find(file => file.name === 'root');