fix: FileStorageUtils: prevent NPE when checking encryption status

This can happen if the parent of a file has been deleted.

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey 2023-02-21 15:14:29 +01:00
parent 654cf8e124
commit a9e4ba9abd
No known key found for this signature in database
GPG key ID: 2585783189A62105

View file

@ -466,7 +466,7 @@ public final class FileStorageUtils {
return true;
}
while (!OCFile.ROOT_PATH.equals(file.getDecryptedRemotePath())) {
while (file != null && !OCFile.ROOT_PATH.equals(file.getDecryptedRemotePath())) {
if (file.isEncrypted()) {
return true;
}