}
account = osso_abook_account_get (EVC_EMAIL, NULL, address);
- dialog = osso_abook_add_to_contacts_dialog_new (contact_model, account);
- g_object_unref (account);
- gtk_dialog_run (GTK_DIALOG (dialog));
+ if (account)
+ {
+ dialog = osso_abook_add_to_contacts_dialog_new (contact_model, account);
+ g_object_unref (account);
+ gtk_dialog_run (GTK_DIALOG (dialog));
- if (contact_model) {
- g_object_unref (contact_model);
- contact_model = NULL;
- }
+ if (contact_model) {
+ g_object_unref (contact_model);
+ contact_model = NULL;
+ }
- gtk_widget_destroy (dialog);
+ gtk_widget_destroy (dialog);
+ }
}
clipboard = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
selection = gtk_clipboard_wait_for_text (clipboard);
- modest_address_book_add_address (selection);
- g_free (selection);
+ /* Question: why is the clipboard being used here?
+ * It doesn't really make a lot of sense. */
+
+ if (selection)
+ {
+ modest_address_book_add_address (selection);
+ g_free (selection);
+ }
}
void