mirror of
https://github.com/nextcloud/android.git
synced 2024-12-19 15:33:00 +03:00
get storage manager, stop if null (this happens while a long async thread, e.g. photo fetching, is cancelled by device orientation changing)
This commit is contained in:
parent
b1f60cb63b
commit
399ff5802f
2 changed files with 8 additions and 4 deletions
|
@ -487,13 +487,13 @@ public class FileListListAdapter extends BaseAdapter {
|
|||
}
|
||||
|
||||
public void setData(ArrayList<Object> objects, ExtendedListFragment.SearchType searchType, FileDataStorageManager storageManager) {
|
||||
if (storageManager != null) {
|
||||
if (storageManager != null && mStorageManager == null) {
|
||||
mStorageManager = storageManager;
|
||||
}
|
||||
mFiles = new Vector<>();
|
||||
|
||||
// early exit
|
||||
if (objects.size() > 0) {
|
||||
if (objects.size() > 0 && mStorageManager != null) {
|
||||
if (searchType.equals(ExtendedListFragment.SearchType.SHARED_FILTER)) {
|
||||
parseShares(objects);
|
||||
} else {
|
||||
|
|
|
@ -1390,10 +1390,14 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
|
|||
if (getContext() != null && !isCancelled()) {
|
||||
RemoteOperationResult remoteOperationResult = remoteOperation.execute(currentAccount, getContext());
|
||||
|
||||
FileDataStorageManager storageManager = null;
|
||||
if (mContainerActivity != null && mContainerActivity.getStorageManager() != null) {
|
||||
storageManager = mContainerActivity.getStorageManager();
|
||||
}
|
||||
|
||||
if (remoteOperationResult.isSuccess() && remoteOperationResult.getData() != null
|
||||
&& !isCancelled() && searchFragment) {
|
||||
mAdapter.setData(remoteOperationResult.getData(), currentSearchType,
|
||||
mContainerActivity.getStorageManager());
|
||||
mAdapter.setData(remoteOperationResult.getData(), currentSearchType, storageManager);
|
||||
}
|
||||
|
||||
return remoteOperationResult.isSuccess();
|
||||
|
|
Loading…
Reference in a new issue