Add a fallback in case that the pathname is wrong

This commit is contained in:
SPGoding
2019-12-18 17:57:50 -06:00
parent 242d634f1b
commit 26fbc45174
+1 -1
View File
@@ -10,7 +10,7 @@ function changeVersion(version) {
structure = json.root;
} else if (json.roots) {
let id = window.location.pathname.replace(/\/$/, '').replace(/^\//, '');
structure = json.roots.find(e => e.id === id);
structure = json.roots.find(e => e.id === id) || json.roots[0] ;
}
components = json.components;
collections = json.collections;