mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
prevent account NPE
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
ae2ac1c26d
commit
213646cb41
1 changed files with 5 additions and 0 deletions
|
@ -236,6 +236,11 @@ public abstract class PreferenceManager {
|
|||
public static String getFolderPreference(Context context, String preferenceName, OCFile folder,
|
||||
String defaultValue) {
|
||||
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
|
||||
|
||||
if (account == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
ArbitraryDataProvider dataProvider = new ArbitraryDataProvider(context.getContentResolver());
|
||||
FileDataStorageManager storageManager = ((ComponentsGetter)context).getStorageManager();
|
||||
String value = dataProvider.getValue(account.name, getKeyFromFolder(preferenceName, folder));
|
||||
|
|
Loading…
Reference in a new issue