~alexlauni/indicator-messages/fix-0-count-lp1071640

« back to all changes in this revision

Viewing changes to libmessaging-menu/messaging-menu.c

  • Committer: Lars Uebernickel
  • Date: 2012-10-02 17:15:38 UTC
  • mfrom: (317.1.1 lp1058386)
  • Revision ID: lars.uebernickel@canonical.com-20121002171538-ub6iniznxg032z5m
Merge lp:~larsu/indicator-messages/lp1058386

Don't crash when getting an invalid desktop id.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
{
149
149
  gchar *path;
150
150
 
151
 
  g_return_val_if_fail (app->appinfo != NULL, NULL);
 
151
  if (!app->appinfo)
 
152
    return NULL;
152
153
 
153
154
  path = g_strconcat ("/com/canonical/indicator/messages/",
154
155
                      g_app_info_get_id (G_APP_INFO (app->appinfo)),
170
171
  guint id;
171
172
  gchar *object_path;
172
173
 
 
174
  object_path = messaging_menu_app_get_dbus_object_path (app);
 
175
  if (!object_path)
 
176
    return;
 
177
 
173
178
  bus = g_bus_get_finish (res, &error);
174
179
  if (bus == NULL)
175
180
    {
178
183
      return;
179
184
    }
180
185
 
181
 
  object_path = messaging_menu_app_get_dbus_object_path (app);
182
 
 
183
186
  id = g_dbus_connection_export_action_group (bus,
184
187
                                              object_path,
185
188
                                              G_ACTION_GROUP (app->source_actions),
479
482
    return;
480
483
 
481
484
  object_path = messaging_menu_app_get_dbus_object_path (app);
 
485
  if (!object_path)
 
486
    return;
482
487
 
483
488
  indicator_messages_service_call_register_application (app->messages_service,
484
489
                                                        g_app_info_get_id (G_APP_INFO (app->appinfo)),
510
515
  if (!app->messages_service)
511
516
    return;
512
517
 
 
518
  if (!app->appinfo)
 
519
    return;
 
520
 
513
521
  indicator_messages_service_call_unregister_application (app->messages_service,
514
522
                                                          g_app_info_get_id (G_APP_INFO (app->appinfo)),
515
523
                                                          app->cancellable,
546
554
  if (!app->messages_service)
547
555
    return;
548
556
 
 
557
  if (!app->appinfo)
 
558
    return;
 
559
 
549
560
  indicator_messages_service_call_set_status (app->messages_service,
550
561
                                              g_app_info_get_id (G_APP_INFO (app->appinfo)),
551
562
                                              status_ids [status],