Index: src/libs/zbxdbcache/dbconfig.c
===================================================================
--- src/libs/zbxdbcache/dbconfig.c	(revision 59916)
+++ src/libs/zbxdbcache/dbconfig.c	(working copy)
@@ -7575,7 +7575,7 @@
  *             text           - [IN] the text value to expand                 *
  *             validator_func - [IN] an optional validator function           *
  *             error          - [OUT] the error message if expanding macros   *
- *                                    failed                                  *
+ *                                    failed (optional)                       *
  *                                                                            *
  * Return value: The text value with expanded user macros.                    *
  *                                                                            *
@@ -7617,7 +7617,9 @@
 		}
 		else
 		{
-			*error = zbx_dsprintf(*error, "macro '%.*s' is not found", len, ptr);
+			if (NULL != error)
+				*error = zbx_dsprintf(*error, "macro '%.*s' is not found", len, ptr);
+
 			ret = FAIL;
 		}
 
