Skip to content

Commit a398bb9

Browse files
committed
chore: reduce spotbugs
Signed-off-by: alperozturk <[email protected]>
1 parent d0cc3a8 commit a398bb9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/main/java/com/owncloud/android/services/OperationsService.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,11 @@ private Pair<Target, RemoteOperation> newOperation(Intent operationIntent) {
690690
case ACTION_REMOVE:
691691
// Remove file or folder
692692
OCFile file = IntentExtensionsKt.getParcelableArgument(operationIntent, EXTRA_FILE, OCFile.class);
693+
if (file == null) {
694+
Log_OC.w(TAG, "file is null cannot remove file");
695+
break;
696+
}
697+
693698
boolean onlyLocalCopy = operationIntent.getBooleanExtra(EXTRA_REMOVE_ONLY_LOCAL, false);
694699
boolean inBackground = operationIntent.getBooleanExtra(EXTRA_IN_BACKGROUND, false);
695700
operation = new RemoveFileOperation(file,
@@ -748,6 +753,11 @@ private Pair<Target, RemoteOperation> newOperation(Intent operationIntent) {
748753

749754
case ACTION_RESTORE_VERSION:
750755
FileVersion fileVersion = IntentExtensionsKt.getParcelableArgument(operationIntent, EXTRA_FILE_VERSION, FileVersion.class);
756+
if (fileVersion == null) {
757+
Log_OC.w(TAG, "file version is null cannot restore file");
758+
break;
759+
}
760+
751761
operation = new RestoreFileVersionRemoteOperation(fileVersion.getLocalId(),
752762
fileVersion.getFileName());
753763
break;

0 commit comments

Comments
 (0)