aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-05 21:19:30 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-05 21:19:30 -0800
commitd5da3c9a958de044ad934290d72ee9e1213fa427 (patch)
tree9a2bc5efd8748fc9d85c34265d86068e4eb1dba6
parent9904272d2fd6c471641d3e37b5e4fe7e6b255765 (diff)
downloadsubsurface-d5da3c9a958de044ad934290d72ee9e1213fa427.tar.gz
Prevent crash when no default device is set
We were dereferencing the default device, even if not set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--gtk-gui.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 943a657e5..006d1634f 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -1700,7 +1700,8 @@ static GtkComboBox *dc_device_selector(GtkWidget *vbox)
if (default_index != -1)
gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), default_index);
else
- gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo_box))),
+ if (default_dive_computer_device)
+ gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo_box))),
default_dive_computer_device);
return GTK_COMBO_BOX(combo_box);