diff options
| author | Jani Nikula <jani@nikula.org> | 2016-09-13 20:14:18 +0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2016-09-17 09:08:58 -0300 |
| commit | ca82d481a1040ed3a47ad9c5e7cf7ec16e5e2ced (patch) | |
| tree | 7ce2fda9f04c624ee83eb5c0a0b9ce52e2a82601 | |
| parent | 78520673fa9e42c3f0856913a00a9bf3c7a05489 (diff) | |
cli/reply: check for NULL list first in scan_address_list()
Support passing NULL list later on. Also use it to simplify the
recursion.
| -rw-r--r-- | notmuch-reply.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c index 9b78ea2c..d90f46f9 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -192,6 +192,9 @@ scan_address_list (InternetAddressList *list, int i; unsigned int n = 0; + if (list == NULL) + return 0; + for (i = 0; i < internet_address_list_length (list); i++) { address = internet_address_list_get_address (list, i); if (INTERNET_ADDRESS_IS_GROUP (address)) { @@ -200,9 +203,6 @@ scan_address_list (InternetAddressList *list, group = INTERNET_ADDRESS_GROUP (address); group_list = internet_address_group_get_members (group); - if (group_list == NULL) - continue; - n += scan_address_list (group_list, config, message, type, user_from); } else { InternetAddressMailbox *mailbox; |
