From 7e4879a26e9fe410ae0894683e8fe267ef80df98 Mon Sep 17 00:00:00 2001 From: "Lars K.W. Gohlke" Date: Wed, 6 Jul 2016 02:02:47 +0200 Subject: [PATCH] fix NPE, when pressing back button on LogActivity (fixes #604) --- .../syncthingandroid/activities/SettingsActivity.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/activities/SettingsActivity.java b/src/main/java/com/nutomic/syncthingandroid/activities/SettingsActivity.java index d501ade7..35d5986f 100644 --- a/src/main/java/com/nutomic/syncthingandroid/activities/SettingsActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/activities/SettingsActivity.java @@ -2,6 +2,7 @@ package com.nutomic.syncthingandroid.activities; import android.app.Fragment; import android.app.FragmentManager; +import android.content.Intent; import android.os.Bundle; import com.nutomic.syncthingandroid.R; @@ -42,7 +43,13 @@ public class SettingsActivity extends SyncthingActivity { mFragment = fm.getFragment(savedInstanceState, savedInstanceState.getString("fragment_name")); } else { - switch (getIntent().getAction()) { + String action = getIntent().getAction(); + + if (action == null) { + action = ACTION_APP_SETTINGS; + } + + switch (action) { case ACTION_APP_SETTINGS: setTitle(R.string.settings_title); mFragment = new SettingsFragment();