Browse Source

Merge pull request #4397 from nextcloud/npeInRemove

parent file can be null
Andy Scherzinger 5 years ago
parent
commit
ed75cffa58

+ 1 - 1
scripts/analysis/findbugs-results.txt

@@ -1 +1 @@
-412
+411

+ 2 - 1
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -1892,7 +1892,8 @@ public class FileDisplayActivity extends FileActivity
                 setFile(getStorageManager().getFileById(removedFile.getParentId()));
                 cleanSecondFragment();
             }
-            if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
+            OCFile parentFile = getStorageManager().getFileById(removedFile.getParentId());
+            if (parentFile != null && parentFile.equals(getCurrentDir())) {
                 refreshListOfFilesFragment(false);
             }
             supportInvalidateOptionsMenu();