From d531309cf97d417f20276691a0c66d2404a51651 Mon Sep 17 00:00:00 2001 From: m-holger Date: Mon, 24 Jul 2023 18:51:30 +0100 Subject: [PATCH] Fix QPDFObjectHandle::disconnect (partially fixes #1011) --- libqpdf/QPDFObjectHandle.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 3ce748b0..17894560 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -231,7 +231,7 @@ QPDFObjectHandle::disconnect() // Recursively remove association with any QPDF object. This method may only be called during // final destruction. QPDF::~QPDF() calls it for indirect objects using the object pointer // itself, so we don't do that here. Other objects call it through this method. - if (!isIndirect()) { + if (obj && !isIndirect()) { this->obj->disconnect(); } }