diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-06-30 04:16:28 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-06-30 04:16:28 +0000 |
commit | be25921dd3ee581b7b312baf6127f7b628ce186e (patch) | |
tree | 2310c3902e1c05b8a669a49d26fe599db78b3f15 | |
parent | 1f101bcb3952ce79440d0236313f3ed11cba2aaa (diff) |
Fix crash if user cancels a process in the middle and there's nothing to save to a file yet.
-rw-r--r-- | hardinfo2/syncmanager.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/hardinfo2/syncmanager.c b/hardinfo2/syncmanager.c index f25f0457..675b0a19 100644 --- a/hardinfo2/syncmanager.c +++ b/hardinfo2/syncmanager.c @@ -275,10 +275,9 @@ static void _action_call_function_got_response(SoupMessage *msg, gpointer user_d SyncNetAction *sna = (SyncNetAction *) user_data; gchar *string; - string = _soup_get_xmlrpc_value_string(msg, sna); - DEBUG("received string: %s\n", string); - - if (sna->entry->save_to) { + if ((string = _soup_get_xmlrpc_value_string(msg, sna)) && + sna->entry->save_to) { + DEBUG("received string: %s\n", string); gchar *filename = g_build_filename(g_get_home_dir(), ".hardinfo", sna->entry->save_to, NULL); @@ -496,10 +495,13 @@ static void sync_dialog_netarea_start_actions(SyncDialog *sd, SyncNetAction sna[ gtk_image_set_from_pixbuf(GTK_IMAGE(icons[i]), icon_cache_get_pixbuf("dialog-error.png")); if (sna[i].error) { - g_warning("Failed while performing \"%s\". Please file a bug report " \ - "if this problem persists. (Use the Help\342\206\222Report" \ - " bug option.)\n\nDetails: %s", - sna[i].name, sna[i].error->message); + if (sna[i].error->code != 1) { + /* the user has not cancelled something... */ + g_warning("Failed while performing \"%s\". Please file a bug report " \ + "if this problem persists. (Use the Help\342\206\222Report" \ + " bug option.)\n\nDetails: %s", + sna[i].name, sna[i].error->message); + } g_error_free(sna[i].error); } else { |