mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
fix potential NPE
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
a4829d4567
commit
5e58fdae4c
1 changed files with 11 additions and 1 deletions
|
@ -779,6 +779,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
user,
|
||||
activity);
|
||||
|
||||
if (metadata == null) {
|
||||
throw new IllegalStateException("metadata is null!");
|
||||
}
|
||||
|
||||
// update ocFile
|
||||
RefreshFolderOperation.updateFileNameForEncryptedFile(mStorageManager, metadata, ocFile);
|
||||
ocFile = mStorageManager.saveFileWithParent(ocFile, activity);
|
||||
|
@ -808,7 +812,13 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
cv.put(ProviderMeta.ProviderTableMeta.VIRTUAL_OCFILE_ID, ocFile.getFileId());
|
||||
|
||||
contentValues.add(cv);
|
||||
} catch (RemoteOperationFailedException | OperationCanceledException | AuthenticatorException | IOException | AccountUtils.AccountNotFoundException e) {
|
||||
} catch (
|
||||
RemoteOperationFailedException |
|
||||
OperationCanceledException |
|
||||
AuthenticatorException |
|
||||
IOException |
|
||||
AccountUtils.AccountNotFoundException |
|
||||
IllegalStateException e) {
|
||||
Log_OC.e(TAG, "Error saving file with parent" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue