Merge pull request #10560 from civicrm/4.7.21-rc
[civicrm-core.git] / api / api.php
index 1675d9d1aa0066a326d147a91802699df2d909ba..5c432630a8e5ab8ab5d4f6dfc49c6517f8df2405 100644 (file)
@@ -136,6 +136,10 @@ function _civicrm_api_replace_variables(&$params, &$parentResult, $separator = '
     elseif (is_array($value) && is_string(reset($value)) && substr(reset($value), 0, 6) == '$value') {
       $key = key($value);
       $value[$key] = _civicrm_api_replace_variable($value[$key], $parentResult, $separator);
+      // A null value with an operator will cause an error, so remove it.
+      if ($value[$key] === NULL) {
+        $value = '';
+      }
     }
   }
 }