Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/conf/domain_conf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 49b68c2c68..6922ebf407 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17649,7 +17649,11 @@ virDomainDiskByName(virDomainDefPtr def, bool allow_ambiguous) { int idx = virDomainDiskIndexByName(def, name, allow_ambiguous); - return idx < 0 ? NULL : def->disks[idx]; + + if (idx < 0) + return NULL; + + return def->disks[idx]; } -- 2.28.0