Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx> --- personal pipeline: https://gitlab.com/eskultety/libvirt/-/pipelines/239002989 Pushed under the build breaker rule. src/util/virmdev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/util/virmdev.c b/src/util/virmdev.c index fc27e9e45d..46db6249de 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -354,7 +354,12 @@ virMediatedDevicePtr virMediatedDeviceListSteal(virMediatedDeviceListPtr list, virMediatedDevicePtr dev) { - int idx = virMediatedDeviceListFindIndex(list, dev->path); + int idx = -1; + + if (!dev) + return NULL; + + idx = virMediatedDeviceListFindIndex(list, dev->path); return virMediatedDeviceListStealIndex(list, idx); } -- 2.29.2