From d687d3e285bf203c0594b1f7cc64a8bf7a27c93b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 3 Apr 2021 16:19:13 +0300 Subject: thy shall check for the error code even if it's not probable --- plugins/Import/src/import.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 183152c98f..f1e270eac7 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -786,6 +786,12 @@ MCONTACT CImportBatch::ImportContact(MCONTACT hSrc) // adding missing contact MCONTACT hDst = db_add_contact(); + if (hDst == INVALID_CONTACT_ID) { + nSkippedContacts++; + AddMessage(LPGENW("Failed to create contact %s (%s)"), cc->szProto, pszUniqueID); + return 0; + } + if (Proto_AddToContact(hDst, szDstModuleName) != 0) { db_delete_contact(hDst); AddMessage(LPGENW("Failed to add %S contact %s"), szDstModuleName, pszUniqueID); -- cgit v1.2.3