diff --git a/src/libvirt.c b/src/libvirt.c index a6fcab0c26..3f65f12ea0 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -10739,7 +10739,8 @@ virDomainSetMetadata(virDomainPtr domain, break; case VIR_DOMAIN_METADATA_ELEMENT: virCheckNonNullArgGoto(uri, error); - virCheckNonNullArgGoto(key, error); + if (metadata) + virCheckNonNullArgGoto(key, error); break; default: /* For future expansion */