Skip to content
This repository was archived by the owner on Feb 1, 2018. It is now read-only.

Commit a05ceae

Browse files
committed
Check for null on foreach
1 parent e1a8416 commit a05ceae

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

dist/main.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@
157157
}
158158
for (var v in versions) {
159159
var version = versions[v];
160-
version.forEach(folderIn);
160+
if(version !== null)
161+
version.forEach(folderIn);
161162
}
162163
return versions;
163164
};
@@ -397,7 +398,10 @@
397398
$location.path(retObj.locationPath);
398399
}
399400

400-
if ($route.current.params.file === 'index') {
401+
var pathCheck = location.path.split('/');
402+
var lastPath = pathCheck[pathCheck.length-1];
403+
404+
if ($route.current.params.file === 'index' || lastPath === 'index') {
401405
retObj.index = true;
402406
retObj.currentFolder = $route.current.params.folder;
403407
deferred.resolve(retObj);
@@ -511,7 +515,8 @@
511515

512516
for (var version in data.map) {
513517
if (version === data.currentVersion) {
514-
data.map[version].forEach(versionIn);
518+
if(data.map[version] !== null)
519+
data.map[version].forEach(versionIn);
515520
}
516521
}
517522
} else {

0 commit comments

Comments
 (0)