Fwd: fix crash when apply a non-edit of nicknames

Amit Chaudhuri amit.k.chaudhuri at gmail.com
Tue Jan 22 23:31:42 PST 2013


This time with attachment..

---------- Forwarded message ----------
From: Amit Chaudhuri <amit.k.chaudhuri at gmail.com>
Date: Wed, Jan 23, 2013 at 7:30 AM
Subject: fix crash when apply a non-edit of nicknames
To: Subsurface Mailing List <subsurface at hohndel.org>


As reported by Henrik, there was a crash lurking in edit_dc_nickname code.
Invoking the dialog and selecting apply without changes exposed it neatly.

This is a one line fix.

Signed off by Amit Chaudhuri <amit.k.chaudhuri at gmail.com>

Looking at some other improvements, but they will come separately once
cleaned up.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130123/8d1eaed5/attachment.html>
-------------- next part --------------
diff --git a/gtk-gui.c b/gtk-gui.c
index 0161597..e165012 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -1283,7 +1283,7 @@ static void edit_dc_nicknames(GtkWidget *w, gpointer data)
 			}
 			gtk_widget_destroy(confirm);
 		}
-		if (res == GTK_RESPONSE_APPLY && holdnicknames->model != NULL ) {
+		if (res == GTK_RESPONSE_APPLY && holdnicknames && holdnicknames->model != NULL ) {
 			struct device_info * walk = holdnicknames;
 			struct device_info * release = holdnicknames;
 			struct device_info * track = holdnicknames->next;


More information about the subsurface mailing list