소스 검색

add null check

Andy Scherzinger 5 년 전
부모
커밋
2f60b75fc5
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/main/java/com/owncloud/android/utils/FileStorageUtils.java

+ 3 - 1
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;
     }