From 8335b10a6afe4511225d062b820320f625633939 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 28 Jul 2013 22:02:56 +1200 Subject: [PATCH] CRM-13072 a bit of extra getcount error handling --- api/v3/Generic.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/v3/Generic.php b/api/v3/Generic.php index d2619f0e1c..8490145b59 100644 --- a/api/v3/Generic.php +++ b/api/v3/Generic.php @@ -139,6 +139,9 @@ function civicrm_api3_generic_getcount($apiRequest) { if(is_numeric (CRM_Utils_Array::value('values', $result))) { return (int) $result['values']; } + if(!isset($result['count'])) { + throw new API_Exception(ts('Unexpected result from getcount') . print_r($result, TRUE)); + } return $result['count']; } -- 2.25.1