Commit 643fbeee authored by patrick pereira's avatar patrick pereira 🏃

main: Check if object is valid before accessing it

Signed-off-by: patrick pereira's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent c6d8a814
...@@ -183,7 +183,8 @@ Kirigami.ApplicationWindow { ...@@ -183,7 +183,8 @@ Kirigami.ApplicationWindow {
return 0.0; return 0.0;
} }
if (!currentVehicle.gpsPosition.isValid) { // If currentVehicle is null or there is no valid position, set distance to zero
if (!currentVehicle || !currentVehicle.gpsPosition.isValid) {
return 0.0; return 0.0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment