Don't set the username if it's empty in update_tny_account()
authorAlberto Garcia <agarcia@igalia.com>
Wed, 28 Nov 2007 11:39:48 +0000 (11:39 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Wed, 28 Nov 2007 11:39:48 +0000 (11:39 +0000)
or it will cause an assertion in tinymail to fail

pmo-trunk-r3835

src/modest-tny-account.c

index 9a53421..7fcd6b2 100644 (file)
@@ -360,7 +360,7 @@ update_tny_account (TnyAccount *tny_account, ModestAccountMgr *account_mgr,
                                                      MODEST_ACCOUNT_OPTION_CHECK_ALL);
                }
                
-               if (account_data->username) 
+               if (account_data->username && strlen(account_data->username) > 0)
                        tny_account_set_user (tny_account, account_data->username);
                if (account_data->hostname)
                        tny_account_set_hostname (tny_account, account_data->hostname);