Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3433041 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Fix NPE

parent b312a39e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -113,6 +113,10 @@ public class CreateFolderRemoteOperation extends RemoteOperation {
    }

    private RemoteOperationResult createParentFolder(String parentPath, OwnCloudClient client) {
        if (parentPath == null)  {
            return new RemoteOperationResult(RemoteOperationResult.ResultCode.FILE_NOT_FOUND);
        }

        RemoteOperation operation = new CreateFolderRemoteOperation(parentPath, mCreateFullPath);
        return operation.execute(client);
    }
+7 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@

package com.owncloud.android.lib.resources.files;

import android.util.Log;

import java.io.File;

public class FileUtils {
@@ -35,6 +37,11 @@ public class FileUtils {

	public static String getParentPath(String remotePath) {
		String parentPath = new File(remotePath).getParent();
		if (parentPath == null) {
			Log.w(TAG, "File.getParent() returns null for " + remotePath);
			return null;
		}

		parentPath = parentPath.endsWith(PATH_SEPARATOR) ? parentPath : parentPath + PATH_SEPARATOR;
		return parentPath;
	}