fixed another npe

This commit is contained in:
iNPUTmice 2014-08-22 13:22:34 +02:00
parent c40c8ee910
commit 9b0bf9b5bc

View file

@ -177,14 +177,17 @@ public class XmppConnectionService extends Service {
reconnectAccount(account, true); reconnectAccount(account, true);
} else if ((account.getStatus() != Account.STATUS_CONNECTING) } else if ((account.getStatus() != Account.STATUS_CONNECTING)
&& (account.getStatus() != Account.STATUS_NO_INTERNET)) { && (account.getStatus() != Account.STATUS_NO_INTERNET)) {
int next = account.getXmppConnection().getTimeToNextAttempt(); XmppConnection connection = account.getXmppConnection();
if (connection!=null) {
int next = connection.getTimeToNextAttempt();
Log.d(LOGTAG, account.getJid() Log.d(LOGTAG, account.getJid()
+ ": error connecting account. try again in " + next + ": error connecting account. try again in " + next
+ "s for the " + "s for the "
+ (account.getXmppConnection().getAttempt() + 1) + (connection.getAttempt() + 1)
+ " time"); + " time");
scheduleWakeupCall((int) (next * 1.2), false); scheduleWakeupCall((int) (next * 1.2), false);
} }
}
UIHelper.showErrorNotification(getApplicationContext(), UIHelper.showErrorNotification(getApplicationContext(),
getAccounts()); getAccounts());
} }