diff --git a/src/util/virhook.c b/src/util/virhook.c index 25d0783bfb..ee19382c4a 100644 --- a/src/util/virhook.c +++ b/src/util/virhook.c @@ -300,7 +300,8 @@ virHookCall(int driver, if (ret < 0) { /* Convert INTERNAL_ERROR into known error. */ virErrorPtr err = virGetLastError(); - virReportError(VIR_ERR_HOOK_SCRIPT_FAILED, "%s", err->message); + virReportError(VIR_ERR_HOOK_SCRIPT_FAILED, "%s", + err ? err->message : _("unknown error")); } virCommandFree(cmd);