From: Andrea Zagli Date: Sat, 8 Oct 2016 10:04:32 +0000 (+0200) Subject: Error if key description is null on key editing. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=7e3a4c21938c1b8b48fad9b45140d088742c15c7;p=zakconfi%2Fgui Error if key description is null on key editing. --- diff --git a/src/main.c b/src/main.c index ed2164b..9761864 100644 --- a/src/main.c +++ b/src/main.c @@ -635,7 +635,14 @@ on_mnuKeysEdit_activate (GtkMenuItem *menuitem, gtk_entry_set_text (GTK_ENTRY (txtParent), ck->path); gtk_entry_set_text (GTK_ENTRY (txtName), ck->key); gtk_entry_set_text (GTK_ENTRY (txtValue), ck->value); - gtk_text_buffer_set_text (buffer, ck->description, strlen (ck->description)); + if (ck != NULL) + { + gtk_text_buffer_set_text (buffer, ck->description, -1); + } + else + { + gtk_text_buffer_set_text (buffer, "", -1); + } if (gtk_dialog_run (GTK_DIALOG (diag)) == GTK_RESPONSE_OK) {