From d73b430cf8700e1c59417c8df6d37afdff2d465e Mon Sep 17 00:00:00 2001 From: Lode Hoste Date: Mon, 23 Mar 2015 12:33:05 +0100 Subject: [PATCH] Only access the version information when the SyncthingService is active (fixes #292). --- .../syncthingandroid/fragments/SettingsFragment.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java index 84225c0c..56f4629e 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java @@ -54,11 +54,10 @@ public class SettingsFragment extends PreferenceFragment mOptionsScreen.setEnabled(currentState == SyncthingService.State.ACTIVE); mGuiScreen.setEnabled(currentState == SyncthingService.State.ACTIVE); - Preference syncthingVersion = getPreferenceScreen().findPreference(SYNCTHING_VERSION_KEY); - syncthingVersion.setSummary(mSyncthingService.getApi().getVersion()); - RestApi api = mSyncthingService.getApi(); - if (currentState == SyncthingService.State.ACTIVE) { + Preference syncthingVersion = getPreferenceScreen().findPreference(SYNCTHING_VERSION_KEY); + syncthingVersion.setSummary(mSyncthingService.getApi().getVersion()); + RestApi api = mSyncthingService.getApi(); for (int i = 0; i < mOptionsScreen.getPreferenceCount(); i++) { final Preference pref = mOptionsScreen.getPreference(i); pref.setOnPreferenceChangeListener(SettingsFragment.this);