conf: events: handle NULL uuid

Not all objects have a uuid, such as nodedevs. When we add events
support for them, NULL will be passed here, so handle it.
This commit is contained in:
Jovanka Gulicoska 2016-07-19 19:23:06 +02:00 committed by Cole Robinson
parent 128a8b2c9f
commit 2bfa751344

View File

@ -659,7 +659,8 @@ virObjectEventNew(virClassPtr klass,
return NULL;
}
event->meta.id = id;
memcpy(event->meta.uuid, uuid, VIR_UUID_BUFLEN);
if (uuid)
memcpy(event->meta.uuid, uuid, VIR_UUID_BUFLEN);
VIR_DEBUG("obj=%p", event);
return event;