on xenial help sign in
Only emit if we can connect to upstart
commit2535deb1649dd9641a2f73e22b78dbf6ccd53790 authorTed Gould <ted@gould.cx> dateWed 7 Aug 2013, 11:18 (13 years ago) parentb1c8ba4
1 file changed+8−6
plugins/Unity/Indicators/indicatorsmanager.cpp+8−6
plugins/Unity/Indicators/indicatorsmanager.cpp+8−6
@@ -235,13 +235,15 @@ void IndicatorsManager::setLoaded(bool loaded)
235235 m_loaded = loaded;
236236 Q_EMIT loadedChanged(m_loaded);
237237
238− DBusPendingCall * pending = NULL;
239− if (m_loaded) {
240− pending = upstart_emit_event(m_upstart, "indicator-services-start", NULL, 0, NULL, NULL, NULL, 100);
241− } else {
242− pending = upstart_emit_event(m_upstart, "indicator-services-end", NULL, 0, NULL, NULL, NULL, 100);
238+ if (m_upstart != NULL) {
239+ DBusPendingCall * pending = NULL;
240+ if (m_loaded) {
241+ pending = upstart_emit_event(m_upstart, "indicator-services-start", NULL, 0, NULL, NULL, NULL, 100);
242+ } else {
243+ pending = upstart_emit_event(m_upstart, "indicator-services-end", NULL, 0, NULL, NULL, NULL, 100);
244+ }
245+ dbus_pending_call_unref(pending);
243246 }
244− dbus_pending_call_unref(pending);
245247 }
246248}
247249