diff options
author | Jens Alpers <jensalpers@hotmail.com> | 2022-07-11 02:20:50 +0000 |
---|---|---|
committer | Robert Ancell <robert.ancell@gmail.com> | 2022-07-11 02:20:50 +0000 |
commit | b9bf21a016d4225e85d849102d2f6d1d7b96687c (patch) | |
tree | edf068546c96127cd623ec6432d25ad62e5e2b9d | |
parent | 577d4ba79821880517b54fc94eb621f278edbae1 (diff) | |
download | gnome-control-center-b9bf21a016d4225e85d849102d2f6d1d7b96687c.tar.gz |
Issue 1846, Check for NULL pointer before gtk_editable_set_text
-rw-r--r-- | panels/sharing/cc-sharing-panel.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c index ac189c699..1ac744cf0 100644 --- a/panels/sharing/cc-sharing-panel.c +++ b/panels/sharing/cc-sharing-panel.c @@ -1444,10 +1444,13 @@ cc_sharing_panel_setup_remote_desktop_dialog (CcSharingPanel *self) } } - if (password == NULL) - gtk_editable_set_text (GTK_EDITABLE (self->remote_desktop_password_entry), - pw_generate ()); - + if (password == NULL) + { + char * pw = pw_generate (); + if (pw) + gtk_editable_set_text (GTK_EDITABLE (self->remote_desktop_password_entry), + pw ); + } g_signal_connect (self->remote_desktop_device_name_copy, "clicked", G_CALLBACK (on_device_name_copy_clicked), self); |