From 2f60b75fc50527d7cf557739d09a3cd4afa5fde8 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 25 Jun 2020 18:55:50 +0200 Subject: [PATCH] add null check --- .../java/com/owncloud/android/utils/FileStorageUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/owncloud/android/utils/FileStorageUtils.java b/src/main/java/com/owncloud/android/utils/FileStorageUtils.java index 10554d94cf..cd26236cb9 100644 --- a/src/main/java/com/owncloud/android/utils/FileStorageUtils.java +++ b/src/main/java/com/owncloud/android/utils/FileStorageUtils.java @@ -189,7 +189,9 @@ public final class FileStorageUtils { public static String getParentPath(String remotePath) { String parentPath = new File(remotePath).getParent(); - parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : parentPath + OCFile.PATH_SEPARATOR; + if (parentPath != null) { + parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : parentPath + OCFile.PATH_SEPARATOR; + } return parentPath; }