[goobox] check whether the folder is NULL before using it



commit 8b0b22688f51a726736e5be175859b51e47c64be
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jun 13 09:59:56 2010 +0200

    check whether the folder is NULL before using it

 src/dlg-ripper.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/dlg-ripper.c b/src/dlg-ripper.c
index 413a9e7..502c28d 100644
--- a/src/dlg-ripper.c
+++ b/src/dlg-ripper.c
@@ -598,6 +598,15 @@ rip_current_track (DialogData *data)
 	/* Set the destination file */
 
 	folder = get_destination_folder (data);
+	if (folder == NULL) {
+		error = g_error_new (G_IO_ERROR, G_IO_ERROR_INVALID_FILENAME, "Invalid filename"); /* FIXME */
+		_gtk_error_dialog_from_gerror_show (GTK_WINDOW (data->window),
+						    _("Could not extract tracks"),
+						    &error);
+		gtk_widget_destroy (data->dialog);
+		return;
+	}
+
 	if (! g_file_make_directory_with_parents (folder, NULL, &error)) {
 		if (! g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS)) {
 			_gtk_error_dialog_from_gerror_show (GTK_WINDOW (data->window),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]