Merge pull request #2006 from nextcloud/bugfix/1977/fixNPEinBrowserFile

Bugfix/1977/fix NPE in BrowserFile
This commit is contained in:
Andy Scherzinger 2022-05-09 15:31:05 +02:00 committed by GitHub
commit a5db665571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,7 @@ public class BrowserFile {
if (property instanceof ResourceType) { if (property instanceof ResourceType) {
browserFile.isFile = browserFile.isFile =
!(((ResourceType) property).getTypes().contains(ResourceType.Companion.getCOLLECTION())); !(((ResourceType) property).getTypes().contains(ResourceType.Companion.getCOLLECTION()));
} }
if (property instanceof GetLastModified) { if (property instanceof GetLastModified) {
@ -109,7 +109,7 @@ public class BrowserFile {
} }
} }
if(browserFile.getPermissions().contains("R")){ if (browserFile.getPermissions() != null && browserFile.getPermissions().contains("R")) {
browserFile.isAllowedToReShare = true; browserFile.isAllowedToReShare = true;
} }