From 4dfd85f0109789d61931fb606f6682cf830cb39e Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 10 Dec 2007 08:54:39 +0000 Subject: [PATCH] * some param checks (should prevent a crash ) pmo-trunk-r3887 --- src/modest-tny-account-store.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 8bdbe6d..71b5ebb 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -1204,6 +1204,8 @@ get_tny_account_by (TnyList *accounts, gboolean found = FALSE; TnyAccount *retval = NULL; + g_return_val_if_fail (accounts && TNY_IS_LIST(accounts), NULL); + iter = tny_list_create_iterator (accounts); while (!tny_iterator_is_done (iter) && !found) { TnyAccount *tmp_account = NULL; @@ -1340,14 +1342,16 @@ TnyAccount* modest_tny_account_store_get_smtp_specific_transport_account_for_open_connection (ModestTnyAccountStore *self, const gchar *account_name) { + TnyDevice *device; + + g_return_if_fail (self && MODEST_IS_TNY_ACCOUNT_STORE(self)); + g_return_if_fail (account_name); + /* Get the current connection: */ - TnyDevice *device = modest_runtime_get_device (); + device = modest_runtime_get_device (); if (!tny_device_is_online (device)) return NULL; - - g_return_val_if_fail (self, NULL); - #ifdef MODEST_HAVE_CONIC g_return_val_if_fail (TNY_IS_MAEMO_CONIC_DEVICE (device), NULL); -- 1.7.9.5