diff options
author | Dan Winship <danw@src.gnome.org> | 2000-12-08 03:19:48 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-12-08 03:19:48 +0800 |
commit | 97f16d13a4083faa895e2530f08a98dcc4b584ad (patch) | |
tree | 2c2fa75a46327923ecf52b70a1236ad230c7cdc6 | |
parent | 1dd2597727c3db69f62fa8ea3f8a4132a57040e3 (diff) | |
download | gsoc2013-evolution-97f16d13a4083faa895e2530f08a98dcc4b584ad.tar.gz gsoc2013-evolution-97f16d13a4083faa895e2530f08a98dcc4b584ad.tar.zst gsoc2013-evolution-97f16d13a4083faa895e2530f08a98dcc4b584ad.zip |
Add some g_return_if_fail()s to protect from crashes until the code to
* mail-callbacks.c: (various)
* folder-browser.c (filter_mlist):
* mail-autofilter.c (filter_gui_add_from_message):
* mail-vfolder.c (vfolder_gui_add_from_message): Add some
g_return_if_fail()s to protect from crashes until the code to
enable/disable commands based on how many messages are selected is
done.
svn path=/trunk/; revision=6840
-rw-r--r-- | mail/ChangeLog | 10 | ||||
-rw-r--r-- | mail/folder-browser.c | 2 | ||||
-rw-r--r-- | mail/mail-autofilter.c | 2 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 14 | ||||
-rw-r--r-- | mail/mail-vfolder.c | 2 |
5 files changed, 22 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 0e35982204..b79f1c26fa 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2000-12-07 Dan Winship <danw@helixcode.com> + + * mail-callbacks.c: (various) + * folder-browser.c (filter_mlist): + * mail-autofilter.c (filter_gui_add_from_message): + * mail-vfolder.c (vfolder_gui_add_from_message): Add some + g_return_if_fail()s to protect from crashes until the code to + enable/disable commands based on how many messages are selected is + done. + 2000-12-06 Jeffrey Stedfast <fejj@helixcode.com> * mail-vfolder.c (vfolder_gui_add_rule): Make the vfolder editor diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 3a56ee030e..adc71fc72d 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -427,6 +427,8 @@ filter_mlist (GtkWidget *w, FolderBrowser *fb) char *header_value; const char *header_name; + g_return_if_fail (fb->mail_display->current_message != NULL); + name = mail_mlist_magic_detect_list (fb->mail_display->current_message, &header_name, &header_value); if (name == NULL) return; diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index d1a1795f48..4c354edfc8 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -272,6 +272,8 @@ filter_gui_add_from_message (CamelMimeMessage *msg, int flags) char *userrules, *systemrules; FilterRule *rule; extern char *evolution_dir; + + g_return_if_fail (msg != NULL); fc = filter_context_new (); userrules = g_strdup_printf ("%s/filters.xml", evolution_dir); diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 43692ef6b8..6eb37c48d0 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -425,13 +425,9 @@ mail_reply (CamelFolder *folder, CamelMimeMessage *msg, const char *uid, gboolea EMsgComposer *composer; struct post_send_data *psd; - /* FIXME: I just don't feel like implementing the folder-browser-passing - * garbage. */ - /* FIXME: We really need some way to get the folder_browser into this - function */ - if (!check_send_configuration (NULL) || !folder || - !msg || !uid) - return; + g_return_if_fail (folder != NULL); + g_return_if_fail (msg != NULL); + g_return_if_fail (uid != NULL); psd = g_new (struct post_send_data, 1); psd->folder = folder; @@ -491,7 +487,9 @@ forward_message (FolderBrowser *fb, gboolean attach) GPtrArray *uids; cursor_msg = fb->mail_display->current_message; - if (!check_send_configuration (fb) || !cursor_msg) + g_return_if_fail (cursor_msg != NULL); + + if (!check_send_configuration (fb)) return; composer = e_msg_composer_new (); diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index 8fb7510ffd..cc1821fc68 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -310,6 +310,8 @@ vfolder_gui_add_from_message(CamelMimeMessage *msg, int flags, const char *sourc { VfolderRule *rule; + g_return_if_fail (msg != NULL); + rule = (VfolderRule*)vfolder_rule_from_message(context, msg, flags, source); vfolder_gui_add_rule(rule); } |