Quantcast

Fix crash when printing coordinates with no coordinates availible.

Ludovicus [04-28-19 - 15:33]
Fix crash when printing coordinates with no coordinates availible.
Filename
TomTom.lua
diff --git a/TomTom.lua b/TomTom.lua
index 23fef4a..6871fbb 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -938,6 +938,9 @@ do
     local coord_fmt = "%%.%df, %%.%df"
     function RoundCoords(x,y,prec)
         local fmt = coord_fmt:format(prec, prec)
+        if not x or not y then
+            return "---"
+        end
         return fmt:format(x*100, y*100)
     end