File check-if-service-is-valid.diff of Package appmenu-qt

=== modified file 'src/appmenuplatformmenubar.cpp'
--- src/appmenuplatformmenubar.cpp	2013-01-11 15:05:38 +0000
+++ src/appmenuplatformmenubar.cpp	2013-01-14 15:53:32 +0000
@@ -410,6 +410,10 @@
         registrar = new com::canonical::AppMenu::Registrar(REGISTRAR_SERVICE, REGISTRAR_PATH, QDBusConnection::sessionBus(), 0);
     }
 
+    if (!registrar || !registrar->isValid()) {
+        return false;
+    }
+
     Q_FOREACH(QAction *action, m_menuBar->actions()) {
         if (!action->isSeparator()) {
             m_rootMenu->addAction(action);
@@ -430,9 +434,9 @@
     }
 
     m_registeredWinId = winId;
-    if (registrar) {
-        registrar->RegisterWindow(winId, QDBusObjectPath(m_objectPath));
-    }
+
+    registrar->RegisterWindow(winId, QDBusObjectPath(m_objectPath));
+
     return true;
 }