aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.js b/main.js
index 661a17e..c1c7da9 100644
--- a/main.js
+++ b/main.js
@@ -539,10 +539,10 @@ if (window.location === window.parent.location) {
infoMetadataAccordions.forEach((x) => x.element.replaceChildren());
modal.show();
Promise.allSettled(Object.entries(mapLayers).map(function([grp,lyr]) {
- if (lyr.getSource() instanceof VectorTile) {
+ if (lyr !== null && lyr.getSource() instanceof VectorTile) {
const url = lyr.getSource().getUrls()[0];
if (url === undefined || url.length <= 16 || url.substr(url.length - 16) !== '/{z}/{x}/{y}.pbf') {
- throw new Error(`Invalid URL ${url}`);
+ return new Promise(() => { throw new Error(`Invalid URL ${url}`); });
}
return fetch(url.substr(0, url.length - 16) + '/metadata.json')
.then(function(resp0) {