You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phone at 0% battery, shuts down, app crashes in the background because ChatManager.getInstance() causes a RuntimeException if the Instance is Null, doesn't return Null, so the code in ShutdownReceiver "onReceive" causes the app to crash:
@OverRide
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_SHUTDOWN.equals(intent.getAction())) {
Log.i(TAG, "System shutting down");
// disconnect the current user when the phone shutdown
if(ChatManager.getInstance() != null) {
ChatManager.getInstance().getMyPresenceHandler().dispose();
}
}
}
}
The crash: java.lang.RuntimeException: instance cannot be null. call start first.
at org.chat21.android.core.ChatManager.getInstance(ChatManager.java:409)
at org.chat21.android.core.receivers.ShutdownReceiver.onReceive(ShutdownReceiver.java:23)
The text was updated successfully, but these errors were encountered:
Phone at 0% battery, shuts down, app crashes in the background because ChatManager.getInstance() causes a RuntimeException if the Instance is Null, doesn't return Null, so the code in ShutdownReceiver "onReceive" causes the app to crash:
@OverRide
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_SHUTDOWN.equals(intent.getAction())) {
Log.i(TAG, "System shutting down");
}
The crash: java.lang.RuntimeException: instance cannot be null. call start first.
at org.chat21.android.core.ChatManager.getInstance(ChatManager.java:409)
at org.chat21.android.core.receivers.ShutdownReceiver.onReceive(ShutdownReceiver.java:23)
The text was updated successfully, but these errors were encountered: