Prevent crash

pull/206/head
M66B 3 years ago
parent 7d53bf3d80
commit 40377b0987

@ -2577,6 +2577,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
} }
private void post(Bundle command, ConnectionHelper.NetworkState networkState, List<TupleAccountState> accountStates) { private void post(Bundle command, ConnectionHelper.NetworkState networkState, List<TupleAccountState> accountStates) {
try {
if (!running) { if (!running) {
Log.i("### not running"); Log.i("### not running");
return; return;
@ -2615,6 +2616,26 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
accountState)); accountState));
postValue(result); postValue(result);
} catch (Throwable ex) {
Log.e(ex);
/*
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
at androidx.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager:124)
at androidx.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager:119)
at eu.faircode.email.ServiceSynchronize$MediatorState.post(ServiceSynchronize:2596)
at eu.faircode.email.ServiceSynchronize$MediatorState.post(ServiceSynchronize:2569)
at eu.faircode.email.ServiceSynchronize$MediatorState.access$400(ServiceSynchronize:2546)
at eu.faircode.email.ServiceSynchronize$3.onChanged(ServiceSynchronize:219)
at eu.faircode.email.ServiceSynchronize$3.onChanged(ServiceSynchronize:216)
at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData:152)
at androidx.lifecycle.LiveData.considerNotify(LiveData:133)
at androidx.lifecycle.LiveData.dispatchingValue(LiveData:151)
at androidx.lifecycle.LiveData.setValue(LiveData:309)
at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData:50)
at androidx.lifecycle.LiveData$1.run(LiveData:93)
at android.os.Handler.handleCallback(Handler.java:761)
*/
}
} }
} }

Loading…
Cancel
Save