account possible can be null

This commit is contained in:
tobiasKaminsky 2018-01-03 08:35:32 +01:00
parent ec246eac59
commit d5f0aa7db1
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -164,18 +164,20 @@ public class NotificationsActivity extends FileActivity {
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());
boolean usesOldLogin = arbitraryDataProvider.getBooleanValue(account.name,
AccountUtils.ACCOUNT_USES_STANDARD_PASSWORD);
if (account != null) {
boolean usesOldLogin = arbitraryDataProvider.getBooleanValue(account.name,
AccountUtils.ACCOUNT_USES_STANDARD_PASSWORD);
if (usesOldLogin) {
snackbar = Snackbar.make(emptyContentContainer, R.string.push_notifications_old_login,
Snackbar.LENGTH_INDEFINITE);
} else {
String pushValue = arbitraryDataProvider.getValue(account.name, PushUtils.KEY_PUSH);
if (pushValue == null || pushValue.isEmpty()) {
snackbar = Snackbar.make(emptyContentContainer, R.string.push_notifications_temp_error,
if (usesOldLogin) {
snackbar = Snackbar.make(emptyContentContainer, R.string.push_notifications_old_login,
Snackbar.LENGTH_INDEFINITE);
} else {
String pushValue = arbitraryDataProvider.getValue(account.name, PushUtils.KEY_PUSH);
if (pushValue == null || pushValue.isEmpty()) {
snackbar = Snackbar.make(emptyContentContainer, R.string.push_notifications_temp_error,
Snackbar.LENGTH_INDEFINITE);
}
}
}
}