summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/metacontacts/meta_services.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp
index 0f08521b0c..c30b633790 100644
--- a/src/modules/metacontacts/meta_services.cpp
+++ b/src/modules/metacontacts/meta_services.cpp
@@ -476,8 +476,11 @@ int Meta_ContactDeleted(WPARAM hContact, LPARAM lParam)
// is a subcontact - update meta contact
if (cc->IsSub()) {
- Meta_RemoveContactNumber(cc, Meta_GetContactNumber(cc, hContact), true);
- NotifyEventHooks(hSubcontactsChanged, cc->parentID, 0);
+ DBCachedContact *ccMeta = CheckMeta(cc->parentID);
+ if (ccMeta) {
+ Meta_RemoveContactNumber(ccMeta, Meta_GetContactNumber(ccMeta, hContact), true);
+ NotifyEventHooks(hSubcontactsChanged, ccMeta->contactID, 0);
+ }
return 0;
}