diff --git a/apport/report.py b/apport/report.py index c828c8b63..e913bf208 100644 --- a/apport/report.py +++ b/apport/report.py @@ -971,13 +971,14 @@ def add_kernel_crash_info(self) -> bool: This needs a VmCore in the Report. """ - if "VmCore" not in self: + vm_core = self.get("VmCore") + if vm_core is None: return False with tempfile.NamedTemporaryFile(prefix="apport_vmcore_") as core: - if hasattr(self["VmCore"], "write"): - self["VmCore"].write(core) + if hasattr(vm_core, "write"): + vm_core.write(core) else: - core.write(self["VmCore"]) + core.write(vm_core) core.flush() kver = self["Uname"].split()[1]