mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
esx: Fix error reporting in esxVI_LookupManagedObjectHelper
As the name parameter can be NULL the error message can only contain it conditionally.
This commit is contained in:
parent
ec04914c47
commit
9bf5246f97
@ -5140,8 +5140,14 @@ esxVI_LookupManagedObjectHelper(esxVI_Context *ctx,
|
||||
|
||||
if (candidate == NULL) {
|
||||
if (occurrence != esxVI_Occurrence_OptionalItem) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Could not find %s with name '%s'"), type, name);
|
||||
if (name != NULL) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Could not find %s with name '%s'"), type, name);
|
||||
} else {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Could not find %s"), type);
|
||||
}
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user