From fca5bcd84a37ec28a0f92092e5377f68e2d432b3 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 26 Jun 2007 15:57:57 +0000 Subject: [PATCH] 2007-06-26 Murray Cumming * src/modest-tny-account-store.c: (get_password): Added some checks for NULL to maybe prevent crashes, though I think it was Philip's last commit that actually prevented the crash here when creating a first new account. But the new account is still not usable (no messages are shown) until a restart of the application. pmo-trunk-r2433 --- ChangeLog | 6 ++++++ ChangeLog2 | 9 +++++++++ src/modest-tny-account-store.c | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index acb6b92..30ec5c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1 +1,7 @@ +2007-06-26 Murray Cumming,,, + + reviewed by: + + * src/modest-tny-account-store.c: (get_password): + * please check the svn log instead diff --git a/ChangeLog2 b/ChangeLog2 index efe1a0c..af8d285 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,5 +1,14 @@ 2007-06-26 Murray Cumming + * src/modest-tny-account-store.c: (get_password): + Added some checks for NULL to maybe prevent crashes, though I think + it was Philip's last commit that actually prevented the crash here + when creating a first new account. + But the new account is still not usable (no messages are shown) + until a restart of the application. + +2007-06-26 Murray Cumming + * src/maemo/modest-maemo-global-settings-dialog.c: (idle_select_default_focus): * src/modest-mail-operation.c: (idle_notify_progress), diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 46516ac..e6dd55c 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -391,6 +391,8 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc if (cancel) *cancel = FALSE; + g_return_val_if_fail (account, NULL); + const gchar *key; const TnyAccountStore *account_store; ModestTnyAccountStore *self; @@ -410,7 +412,8 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc /* is it in the hash? if it's already there, it must be wrong... */ pwd_ptr = (gpointer)&pwd; /* pwd_ptr so the compiler does not complained about * type-punned ptrs...*/ - already_asked = g_hash_table_lookup_extended (priv->password_hash, + already_asked = priv->password_hash && + g_hash_table_lookup_extended (priv->password_hash, key, NULL, (gpointer*)&pwd_ptr); -- 1.7.9.5