Check nullability of accountName in FileDisplayActivity.java

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-06-07 12:21:30 +02:00
parent 4dd6a6d277
commit 04f0a00d65
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -13,6 +13,7 @@
*/
package com.owncloud.android.ui.activity;
import android.accounts.Account;
import android.accounts.AuthenticatorException;
import android.annotation.SuppressLint;
import android.app.Activity;
@ -1354,7 +1355,8 @@ public class FileDisplayActivity extends FileActivity
public void onReceive(Context context, Intent intent) {
String uploadedRemotePath = intent.getStringExtra(FileUploadWorker.EXTRA_REMOTE_PATH);
String accountName = intent.getStringExtra(FileUploadWorker.ACCOUNT_NAME);
boolean sameAccount = getAccount() != null && accountName.equals(getAccount().name);
Account account = getAccount();
boolean sameAccount = accountName != null && account != null && accountName.equals(account.name);
OCFile currentDir = getCurrentDir();
boolean isDescendant = currentDir != null && uploadedRemotePath != null && uploadedRemotePath.startsWith(currentDir.getRemotePath());