From cc80e084073f2c890cef6c1c7dabeff1453682ff Mon Sep 17 00:00:00 2001 From: Anavrins Date: Wed, 11 Dec 2019 11:38:12 -0500 Subject: [PATCH] gps.lua: Added nil and nan checks --- sys/modules/opus/gps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/opus/gps.lua b/sys/modules/opus/gps.lua index 0ca7a66..8e85977 100644 --- a/sys/modules/opus/gps.lua +++ b/sys/modules/opus/gps.lua @@ -98,7 +98,7 @@ function GPS.trilaterate(tFixes) if pos2 then pos1, pos2 = narrow(pos1, pos2, tFixes[1]) end - if not pos2 then + if not pos2 and pos1 and not (pos1.x ~= pos1.x) then return pos1, attemps end end