fix exception for CreateAddressbookN()
authorGwangbok Kim <gwangbok.kim@samsung.com>
Wed, 3 Apr 2013 12:14:05 +0000 (21:14 +0900)
committerGwangbok Kim <gwangbok.kim@samsung.com>
Wed, 3 Apr 2013 12:14:05 +0000 (21:14 +0900)
Change-Id: If5085e9aa77fdff6682d458498e72dcead236d4f
Signed-off-by: Gwangbok Kim <gwangbok.kim@samsung.com>
src/FScl_AddressbookManagerImpl.cpp

index f2ff99f..1d77e4b 100644 (file)
@@ -211,6 +211,11 @@ _AddressbookManagerImpl::CreateAddressbookN(AccountId accountId, const String& n
        __Filter<__ContactsAddressbook> filter;
        filter.Construct();
        filter.AddString(_contacts_address_book.name, CONTACTS_MATCH_EXACTLY, pNameString.get());
+       if (accountId != 0)
+       {
+               filter.AddOperator(CONTACTS_FILTER_OPERATOR_OR);
+               filter.AddInt(_contacts_address_book.account_id, CONTACTS_MATCH_EQUAL, accountId);
+       }
 
        __Query<__ContactsAddressbook> query;
        query.Construct();