avoid NPE

This commit is contained in:
sonora 2015-01-03 15:24:59 +01:00
parent 70930ba5c2
commit 7cd99765f5
2 changed files with 2 additions and 2 deletions

View file

@ -507,7 +507,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
@Override
public void updateCompassValue(float value) {
float lastHeading = heading;
float lastHeading = heading != null ? heading : 99;
heading = value;
if (heading != null && Math.abs(MapUtils.degreesDiff(lastHeading, heading)) > 5) {
amenityAdapter.notifyDataSetChanged();

View file

@ -182,7 +182,7 @@ public class DashFavoritesFragment extends DashBaseFragment {
public void updateCompassValue(float value) {
//heading = value;
//updateArrows();
float lastHeading = heading;
float lastHeading = heading != null ? heading : 99;
heading = value;
if (heading != null && Math.abs(MapUtils.degreesDiff(lastHeading, heading)) > 5) {
updateArrows();