Skip to content

Commit

Permalink
Get parent file via id and check existence of parent file
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Sep 12, 2024
1 parent 5ec798c commit 46b8396
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.RemoveFileRemoteOperation;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.utils.MimeTypeUtil;
Expand Down Expand Up @@ -86,7 +87,11 @@ protected RemoteOperationResult run(OwnCloudClient client) {
boolean localRemovalFailed = false;
if (!onlyLocalCopy) {
if (fileToRemove.isEncrypted()) {
OCFile parent = getStorageManager().getFileByPath(fileToRemove.getParentRemotePath());
OCFile parent = getStorageManager().getFileById(fileToRemove.getParentId());
if (parent == null) {
return new RemoteOperationResult(ResultCode.LOCAL_FILE_NOT_FOUND);
}

operation = new RemoveRemoteEncryptedFileOperation(fileToRemove.getRemotePath(),
user,
context,
Expand Down

0 comments on commit 46b8396

Please sign in to comment.