PersistentNotification unregister workaround.

This commit is contained in:
Johannes Mockenhaupt 2017-10-20 20:15:37 +02:00
parent 9442c56eb8
commit d202976251
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -191,11 +191,16 @@ public class PersistentNotificationPlugin implements PluginBase {
private void checkBusRegistration() {
if (fragmentEnabled) {
MainApp.bus().register(this);
try {
MainApp.bus().register(this);
} catch (IllegalArgumentException e) {
// already registered
}
} else {
try {
MainApp.bus().unregister(this);
} catch (Exception e) {
} catch (IllegalArgumentException e) {
// already unregistered
}
}
}