diff --git a/src/util/virperf.c b/src/util/virperf.c index a0997f94b1..4661ba3fb1 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -99,6 +99,9 @@ static virPerfEventPtr virPerfGetEvent(virPerfPtr perf, virPerfEventType type) { + if (!perf) + return NULL; + if (type >= VIR_PERF_EVENT_LAST) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Event '%d' is not supported"),