From fe825ad45ae9c065626e428c5c29b98e47941b97 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Sun, 12 Sep 2021 09:22:45 +0200 Subject: [PATCH] fix: fix dereference in file tree when no fodler is open --- public/script/app.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/public/script/app.js b/public/script/app.js index 7f2853a..2600bc6 100644 --- a/public/script/app.js +++ b/public/script/app.js @@ -194,11 +194,13 @@ angular $scope.opens = {}; - let accumulatedPath = ""; - $routeParams.path.split("/").forEach((f) => { - $scope.opens[accumulatedPath + "/" + f] = true; - accumulatedPath = accumulatedPath + "/" + f; - }); + if ($routeParams.path) { + let accumulatedPath = ""; + $routeParams.path.split("/").forEach((f) => { + $scope.opens[accumulatedPath + "/" + f] = true; + accumulatedPath = accumulatedPath + "/" + f; + }); + } const toArray = function (obj) { const output = [];