From 4be331e3fc92144d707f7d1af7ba20613d394817 Mon Sep 17 00:00:00 2001 From: Yun Liu <yun@yun.(none)> Date: Mon, 6 Oct 2008 11:41:16 -0400 Subject: [PATCH] Fix for bug ticket #91 --- src/managerimpl.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index f1bf959ed1..f1d9cbd97d 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -2319,15 +2319,19 @@ ManagerImpl::getAccountIdFromNameAndServer(const std::string& userName, const st // Try to find the account id from username and server name by full match for(iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { account = dynamic_cast<SIPAccount *>(iter->second); - if(account->fullMatch(userName, server)) - return iter->first; + if (account != NULL){ + if(account->fullMatch(userName, server)) + return iter->first; + } } // We failed! Then only match the username for(iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { account = dynamic_cast<SIPAccount *>(iter->second); - if(account->userMatch(userName)) - return iter->first; + if ( account != NULL ) { + if(account->userMatch(userName)) + return iter->first; + } } // Failed again! return AccountNULL -- GitLab