[balsa/gtk4: 76/311] balsa-mblist: Add guards
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk4: 76/311] balsa-mblist: Add guards
- Date: Fri, 17 Dec 2021 19:53:24 +0000 (UTC)
commit d0b632f28dd19076bac504ee0721fd76b8be6612
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Thu Jul 2 11:12:54 2020 -0400
balsa-mblist: Add guards
src/balsa-mblist.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/balsa-mblist.c b/src/balsa-mblist.c
index 7035abede..5c93af6ba 100644
--- a/src/balsa-mblist.c
+++ b/src/balsa-mblist.c
@@ -2431,7 +2431,11 @@ balsa_mblist_mru_get_url(GSimpleAction *action, GtkWidget *widget, GObject *obje
const gchar *action_name;
const gchar *url;
- action_name = g_action_get_name(G_ACTION(action));
+ g_return_val_if_fail(G_IS_ACTION(action), NULL);
+ g_return_val_if_fail(GTK_IS_WIDGET(widget), NULL);
+ g_return_val_if_fail(G_IS_OBJECT(object), NULL);
+
+ action_name = g_action_get_name((GAction *) action);
url = g_object_get_data(object, action_name);
if (url == NULL) {
@@ -2452,7 +2456,11 @@ balsa_mblist_mru_get_mailbox(GSimpleAction *action, GtkWidget *widget, GObject *
const gchar *url;
LibBalsaMailbox *mailbox;
- action_name = g_action_get_name(G_ACTION(action));
+ g_return_val_if_fail(G_IS_ACTION(action), NULL);
+ g_return_val_if_fail(GTK_IS_WIDGET(widget), NULL);
+ g_return_val_if_fail(G_IS_OBJECT(object), NULL);
+
+ action_name = g_action_get_name((GAction *) action);
url = g_object_get_data(object, action_name);
mailbox = url == NULL ? bmbl_choose_mailbox(widget) : balsa_find_mailbox_by_url(url);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]