Fix possible npe

This commit is contained in:
max-klaus 2021-02-26 18:12:23 +03:00
parent 58a07ad777
commit f7269eed15

View file

@ -1444,8 +1444,9 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
if (!compassUpdateAllowed) { if (!compassUpdateAllowed) {
return; return;
} }
final OsmandApplication app = getMyApplication(); Activity activity = getActivity();
if (app != null && adapter != null) { if (activity != null && adapter != null) {
OsmandApplication app = (OsmandApplication) activity.getApplication();
app.runInUIThread(new Runnable() { app.runInUIThread(new Runnable() {
@Override @Override
public void run() { public void run() {