diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceListFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceListFragment.java index 8b01ec2d..5a652b60 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceListFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/DeviceListFragment.java @@ -38,7 +38,9 @@ public class DeviceListFragment extends ListFragment implements SyncthingService @Override public void onPause() { super.onPause(); - mTimer.cancel(); + if (mTimer != null) { + mTimer.cancel(); + } } @Override diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/FolderFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/FolderFragment.java index feb27ee0..321f221b 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/FolderFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/FolderFragment.java @@ -138,7 +138,7 @@ public class FolderFragment extends Fragment @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), FolderPickerActivity.class); - if (mFolder.path.length() > 0) { + if (!TextUtils.isEmpty(mFolder.path)) { intent.putExtra(FolderPickerActivity.EXTRA_INITIAL_DIRECTORY, mFolder.path); } startActivityForResult(intent, DIRECTORY_REQUEST_CODE); diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/FolderListFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/FolderListFragment.java index d008141a..1fa1daa1 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/FolderListFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/FolderListFragment.java @@ -46,7 +46,9 @@ public class FolderListFragment extends ListFragment implements SyncthingService @Override public void onPause() { super.onPause(); - mTimer.cancel(); + if (mTimer != null) { + mTimer.cancel(); + } } @Override