From 66fc040563da662997aa1bec3f825953892f2d45 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Wed, 25 Jan 2017 14:48:21 +0530 Subject: [PATCH] CRM-19927: Error message when 'Add to Group' is pressed with no group selected --- CRM/Contact/BAO/GroupContact.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index e50f028ad3..8833d1958d 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -134,6 +134,9 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { $status = 'Added', $tracking = NULL ) { + if (empty($contactIds) || empty($groupId)) { + return array(); + } CRM_Utils_Hook::pre('create', 'GroupContact', $groupId, $contactIds); -- 2.25.1