summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-04-03 16:19:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-04-03 16:19:20 +0300
commitd687d3e285bf203c0594b1f7cc64a8bf7a27c93b (patch)
tree9982013bd6e1bfb694dd2e7385313edd8adde245
parent55a67749d677fddc1f982079a69f943446687809 (diff)
thy shall check for the error code even if it's not probable
-rw-r--r--plugins/Import/src/import.cpp6
1 files changed, 6 insertions, 0 deletions
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);