From d1195176143c74b83b2d1ca9d6adc97220e8c5d8 Mon Sep 17 00:00:00 2001 From: Unrud Date: Tue, 18 Jul 2017 05:33:20 +0200 Subject: [PATCH] Don't access devices/folders when config is not loaded (fixes #876) (#924) --- .../nutomic/syncthingandroid/fragments/DeviceListFragment.java | 2 +- .../nutomic/syncthingandroid/fragments/FolderListFragment.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceListFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceListFragment.java index 6a2d7f95..90f72fe2 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceListFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceListFragment.java @@ -77,7 +77,7 @@ public class DeviceListFragment extends ListFragment implements SyncthingService */ private void updateList() { SyncthingActivity activity = (SyncthingActivity) getActivity(); - if (activity.getApi() == null || getView() == null || activity.isFinishing()) + if (activity.getApi() == null || !activity.getApi().isConfigLoaded() || getView() == null || activity.isFinishing()) return; if (mAdapter == null) { diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/FolderListFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/FolderListFragment.java index f73bf7e4..f547fde6 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/FolderListFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/FolderListFragment.java @@ -72,7 +72,7 @@ public class FolderListFragment extends ListFragment implements SyncthingService */ private void updateList() { SyncthingActivity activity = (SyncthingActivity) getActivity(); - if (activity.getApi() == null || getView() == null || activity.isFinishing()) + if (activity.getApi() == null || !activity.getApi().isConfigLoaded() || getView() == null || activity.isFinishing()) return; if (mAdapter == null) {