Fix NullPointerException when invoking equals() on null String reference

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-04-24 13:54:05 +02:00 committed by Alper Öztürk
parent 6c8c58f220
commit 0c1e2bcc1d

View file

@ -1071,12 +1071,14 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
List<OCFile> ret = new ArrayList<>();
for (OCFile file : files) {
if (file.getOwnerId().equals(userId) &&
!file.isSharedWithMe() &&
!file.isGroupFolder()) {
String ownerId = file.getOwnerId();
if (ownerId != null && userId != null) {
if (ownerId.equals(userId) && !file.isSharedWithMe() && !file.isGroupFolder()) {
ret.add(file);
}
}
}
return ret;
}