1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-10 20:15:54 +00:00

Fix NPE if activity is null

This commit is contained in:
Felix Ableitner 2017-08-25 17:10:40 +09:00
parent d3d00ff1d9
commit 204eb194ad
2 changed files with 4 additions and 2 deletions

View file

@ -77,7 +77,8 @@ public class DeviceListFragment extends ListFragment implements SyncthingService
*/
private void updateList() {
SyncthingActivity activity = (SyncthingActivity) getActivity();
if (activity.getApi() == null || !activity.getApi().isConfigLoaded() || getView() == null || activity.isFinishing())
if (activity == null || activity.getApi() == null || !activity.getApi().isConfigLoaded() ||
getView() == null || activity.isFinishing())
return;
if (mAdapter == null) {

View file

@ -72,7 +72,8 @@ public class FolderListFragment extends ListFragment implements SyncthingService
*/
private void updateList() {
SyncthingActivity activity = (SyncthingActivity) getActivity();
if (activity.getApi() == null || !activity.getApi().isConfigLoaded() || getView() == null || activity.isFinishing())
if (activity == null || activity.getApi() == null || !activity.getApi().isConfigLoaded() ||
getView() == null || activity.isFinishing())
return;
if (mAdapter == null) {