Browse Source

add another NPE check

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 7 years ago
parent
commit
3af569988d

+ 1 - 1
src/main/java/com/owncloud/android/operations/UploadFileOperation.java

@@ -373,7 +373,7 @@ public class UploadFileOperation extends SyncOperation {
         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);