diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 37d85f71f3..2bd118c0ef 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -1696,7 +1696,10 @@ xml_errorHandler(void *data, xmlErrorPtr error) appendStringInfo(errorBuf, "line %d: ", error->line); if (name != NULL) appendStringInfo(errorBuf, "element %s: ", name); - appendStringInfoString(errorBuf, error->message); + if (error->message != NULL) + appendStringInfoString(errorBuf, error->message); + else + appendStringInfoString(errorBuf, "(no message provided)"); /* * Append context information to errorBuf.