diff --git a/diskimage_builder/block_device/blockdevice.py b/diskimage_builder/block_device/blockdevice.py index 97e014346..6f3a3a91d 100644 --- a/diskimage_builder/block_device/blockdevice.py +++ b/diskimage_builder/block_device/blockdevice.py @@ -179,6 +179,8 @@ local_loop: """Cleanup all remaining relicts - in good case""" dg, reverse_order, state = self._load_state() + if dg is None: + return 0 for node in reverse_order: node.cleanup(state) @@ -191,6 +193,8 @@ local_loop: """Cleanup all remaining relicts - in case of an error""" dg, reverse_order, state = self._load_state() + if dg is None: + return 0 for node in reverse_order: node.delete(state)