Throw if no accounts are found

Should crash than put out bogus 'User:null' source tags
This commit is contained in:
YuviPanda 2013-02-27 03:46:01 +05:30
parent df95f4791a
commit 12488c01d4

View file

@ -122,6 +122,8 @@ public class CommonsApplication extends Application {
Account[] allAccounts = accountManager.getAccountsByType(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE);
if(allAccounts.length != 0) {
currentAccount = allAccounts[0];
} else {
throw new RuntimeException("No accounts found!");
}
}
return currentAccount;