diff options
author | Christian Dywan <christian.dywan@canonical.com> | 2013-11-06 22:38:53 +0100 |
---|---|---|
committer | Christian Dywan <christian.dywan@canonical.com> | 2013-11-06 22:38:53 +0100 |
commit | 19908d299c79310dd9f87999259426c6296a5621 (patch) | |
tree | f4165a808fcb54a0146edd2c2330cef89baec5bd /midori | |
parent | 9ec78b8ba2f202064acf4925df8df58a50cc5865 (diff) | |
download | midori-19908d299c79310dd9f87999259426c6296a5621.tar.gz |
Check path being NULL in export before trying to inspect it
Diffstat (limited to 'midori')
-rw-r--r-- | midori/midori-browser.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 2d339835..7591595d 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -4635,11 +4635,15 @@ wrong_format: if (midori_dialog_run (GTK_DIALOG (file_dialog)) == GTK_RESPONSE_OK) path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_dialog)); gtk_widget_destroy (file_dialog); + + if (path == NULL) + return; + if (g_str_has_suffix (path, ".xbel")) format = "xbel"; else if (g_str_has_suffix (path, ".html")) format = "netscape"; - else if (path != NULL) + else { sokoke_message_dialog (GTK_MESSAGE_ERROR, _("Midori can only export to XBEL (*.xbel) and Netscape (*.html)"), @@ -4648,9 +4652,6 @@ wrong_format: goto wrong_format; } - if (path == NULL) - return; - error = NULL; bookmarks = midori_bookmarks_db_query_recursive (browser->bookmarks, "*", "parentid IS NULL", NULL, TRUE); |