Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
OCFile parent = getStorageManager().getFileByPath(remoteParentPath);

// in case of a fresh upload with subfolder, where parent does not exist yet
if (parent == null && mFolderUnlockToken.isEmpty()) {
if (parent == null && (mFolderUnlockToken == null || mFolderUnlockToken.isEmpty())) {
// try to create folder
RemoteOperationResult result = grantFolderExistence(remoteParentPath, client);

Expand All @@ -396,7 +396,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {

// try to unlock folder with stored token, e.g. when upload needs to be resumed or app crashed
// the parent folder should exist as it is a resume of a broken upload
if (!mFolderUnlockToken.isEmpty()) {
if (mFolderUnlockToken != null && !mFolderUnlockToken.isEmpty()) {
UnlockFileOperation unlockFileOperation = new UnlockFileOperation(parent.getLocalId(), mFolderUnlockToken);
RemoteOperationResult unlockFileOperationResult = unlockFileOperation.execute(client, true);

Expand Down