messenger-gtk

Gtk+3 graphical user interfaces for GNUnet Messenger
Log | Files | Refs | Submodules | README | LICENSE

commit 8b9553de982477e80ae9465e1eafb50eaa532a7c
parent bc77c65b3e9b5f2624918906ca03f3f2431f5fb2
Author: Jacki <jacki@thejackimonster.de>
Date:   Fri, 19 Jan 2024 00:28:10 +0100

Fix segfault caused by libportal error being null on failure

Signed-off-by: Jacki <jacki@thejackimonster.de>

Diffstat:
Msrc/application.c | 4++--
Msrc/ui/new_contact.c | 2+-
Msrc/ui/settings.c | 6+++---
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/application.c b/src/application.c @@ -160,7 +160,7 @@ application_init(MESSENGER_Application *app, GError *error = NULL; app->portal = xdp_portal_initable_new(&error); - if (!app->portal) + if (error) { g_printerr("ERROR: %s\n", error->message); g_error_free(error); @@ -351,7 +351,7 @@ _request_background_callback(GObject *source_object, portal, result, &error ); - if (!success) { + if (error) { g_printerr("ERROR: %s\n", error->message); g_error_free(error); } diff --git a/src/ui/new_contact.c b/src/ui/new_contact.c @@ -291,7 +291,7 @@ _request_camera_callback(GObject *source_object, portal, result, &error ); - if (!success) { + if (error) { g_printerr("ERROR: %s\n", error->message); g_error_free(error); } diff --git a/src/ui/settings.c b/src/ui/settings.c @@ -59,12 +59,12 @@ _request_background_callback(GObject *source_object, portal, result, &error ); - if (!success) { + if (error) { g_printerr("ERROR: %s\n", error->message); g_error_free(error); - gtk_widget_set_sensitive(GTK_WIDGET(widget), TRUE); - gtk_switch_set_active(widget, FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(widget), !success); + gtk_switch_set_active(widget, success); return; }