From 8d7a1635f92712e0db064f8b8ee1f8edc36b188e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 14 Nov 2025 03:10:05 +0000 Subject: [PATCH] fix: prevent ReferenceError when loading maps before style.js loads Check if heightmapColorSchemes is defined before accessing it to prevent race condition between load.js and style.js initialization. --- modules/io/load.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/io/load.js b/modules/io/load.js index ccfccecb..7692622e 100644 --- a/modules/io/load.js +++ b/modules/io/load.js @@ -477,7 +477,7 @@ async function parseLoadedData(data, mapVersion) { } // add custom heightmap color scheme if any - if (heightmapColorSchemes) { + if (typeof heightmapColorSchemes !== "undefined" && heightmapColorSchemes) { const oceanScheme = byId("oceanHeights")?.getAttribute("scheme"); if (oceanScheme && !(oceanScheme in heightmapColorSchemes)) addCustomColorScheme(oceanScheme); const landScheme = byId("#landHeights")?.getAttribute("scheme");