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:
parent
d3d00ff1d9
commit
204eb194ad
2 changed files with 4 additions and 2 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue