mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Throw if no accounts are found
Should crash than put out bogus 'User:null' source tags
This commit is contained in:
parent
df95f4791a
commit
12488c01d4
1 changed files with 2 additions and 0 deletions
|
|
@ -122,6 +122,8 @@ public class CommonsApplication extends Application {
|
||||||
Account[] allAccounts = accountManager.getAccountsByType(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE);
|
Account[] allAccounts = accountManager.getAccountsByType(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE);
|
||||||
if(allAccounts.length != 0) {
|
if(allAccounts.length != 0) {
|
||||||
currentAccount = allAccounts[0];
|
currentAccount = allAccounts[0];
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("No accounts found!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return currentAccount;
|
return currentAccount;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue