Quantcast

Protect against orphan maps, which the latest HBD now discovers.

Ludovicus [03-18-19 - 21:17]
Protect against orphan maps, which the latest HBD now discovers.
Filename
TomTom.lua
diff --git a/TomTom.lua b/TomTom.lua
index 38b3e5c..fb8b42a 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -1194,7 +1194,7 @@ do
             NameToMapId[name] = nil
             for idx, mapId in pairs(mapID) do
                 local parent = hbd.mapData[mapId].parent
-                local parentName = hbd.mapData[parent].name
+                local parentName = (parent and (parent > 0) and hbd.mapData[parent].name)
                 if parentName then
                     -- We rely on the implicit acending order of mapID's so the lowest one wins
                     if not newEntries[name .. ":" .. parentName] then