diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c index e6d4b59e1..92799e42a 100644 --- a/lib/format_text/archiver.c +++ b/lib/format_text/archiver.c @@ -339,6 +339,11 @@ static int _restore_vg_should_write_pv(struct physical_volume *pv, int do_pvcrea if (!(pv->fmt->features & FMT_PV_FLAGS)) return 0; + if (!pv->dev) { + log_error("Failed to find device for PV."); + return -1; + } + if (!(info = lvmcache_info_from_pvid(pv->dev->pvid, pv->dev, 0))) { log_error("Failed to find cached info for PV %s.", pv_dev_name(pv)); return -1;