Browse Source

Fix "Shared by null" glitch in file details view

When file is uploaded it has ownerId == null.
We shall interpret this condition file being
owned by the current user.

Fixes #5005

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
Chris Narkiewicz 5 years ago
parent
commit
ef8497697a

+ 2 - 1
src/main/java/com/nextcloud/client/account/UserAccountManagerImpl.java

@@ -325,7 +325,8 @@ public class UserAccountManagerImpl implements UserAccountManager {
 
     @Override
     public  boolean accountOwnsFile(OCFile file, Account account) {
-        return !TextUtils.isEmpty(file.getOwnerId()) && account.name.split("@")[0].equals(file.getOwnerId());
+        final String ownerId = file.getOwnerId();
+        return TextUtils.isEmpty(ownerId) || account.name.split("@")[0].equals(ownerId);
     }
 
     public boolean migrateUserId() {