From d162849fae30115e87ce4f745208f55bd72a22cd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 4 Oct 2011 15:57:23 +0400 Subject: Check if internet address list is parsed correctly. --- src/lua/lua_task.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/lua') diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index eb6ba2690..6552b703e 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -827,12 +827,18 @@ lua_task_get_from (lua_State *L) #else addrs = internet_address_list_parse_string (task->from); #endif - lua_push_internet_address_list (L, addrs); + if (L != NULL) { + lua_push_internet_address_list (L, addrs); #ifndef GMIME24 - internet_address_list_destroy (addrs); + internet_address_list_destroy (addrs); #else - g_object_unref (addrs); + g_object_unref (addrs); #endif + } + else { + lua_pushnil (L); + } + return 1; } } -- cgit v1.2.3