From 7a3df455bfcd141893090b7fb6c1d083808a612e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 7 Oct 2014 18:11:02 +0000 Subject: fix for adding events into disabled/unloaded contacts git-svn-id: http://svn.miranda-ng.org/main/trunk@10730 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Import/src/import.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'plugins/Import/src') diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 47b50029c3..43ca275ae6 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -705,12 +705,13 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC // calculate sub's handle for metahistory MCONTACT hOwner = (bIsMeta) ? MapContact(srcDb->GetEventContact(hEvent)) : hDst; - - // add dbevent - if (dstDb->AddEvent(hOwner, &dbei) != NULL) - nMessagesCount++; - else - AddMessage(LPGENT("Failed to add message")); + if (hOwner != INVALID_CONTACT_ID) { + // add dbevent + if (dstDb->AddEvent(hOwner, &dbei) != NULL) + nMessagesCount++; + else + AddMessage(LPGENT("Failed to add message")); + } } else nDupes++; } -- cgit v1.2.3