Skip to content

Commit

Permalink
Merge pull request liodali#485 from vargab95/master
Browse files Browse the repository at this point in the history
fix null pointer exception in map drawing
  • Loading branch information
liodali authored Dec 6, 2023
2 parents 70c81e0 + c6d5e2c commit c09e506
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ class CustomLocationManager(mapView: MapView) : MyLocationNewOverlay(mapView) {
}
}
else -> {
when (lastFix.hasBearing()) {
true -> drawDirection(canvas, pProjection, lastFix)
else -> drawPerson(canvas, pProjection, lastFix)
if (lastFix != null) {
when (lastFix.hasBearing()) {
true -> drawDirection(canvas, pProjection, lastFix)
else -> drawPerson(canvas, pProjection, lastFix)
}
}
}
}
Expand Down Expand Up @@ -233,4 +235,4 @@ class CustomLocationManager(mapView: MapView) : MyLocationNewOverlay(mapView) {
setPersonAnchor(anchor.first().toFloat(),anchor.last().toFloat())
setDirectionAnchor(anchor.first().toFloat(),anchor.last().toFloat())
}
}
}

0 comments on commit c09e506

Please sign in to comment.