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) {
return;
}
final OsmandApplication app = getMyApplication();
if (app != null && adapter != null) {
Activity activity = getActivity();
if (activity != null && adapter != null) {
OsmandApplication app = (OsmandApplication) activity.getApplication();
app.runInUIThread(new Runnable() {
@Override
public void run() {