From 6ad634cc5bca620cb5cf3f3369c72c0fbca4dc5c Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Sun, 23 Oct 2016 00:21:17 +0200 Subject: [PATCH] made getAppSettings more safe --- .../github/dfa/diaspora_android/ui/PodSelectionDialog.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/PodSelectionDialog.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/PodSelectionDialog.java index c843b34e..62a78550 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/PodSelectionDialog.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/PodSelectionDialog.java @@ -145,7 +145,11 @@ public class PodSelectionDialog extends ThemedAppCompatDialogFragment { @Override protected AppSettings getAppSettings() { - return app.getSettings(); + if(isAdded()) { + return ((App) getActivity().getApplication()).getSettings(); + } else { + return new AppSettings(getContext().getApplicationContext()); + } } @OnItemSelected(R.id.podselection__dialog__spinner_profile)