aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFObjectHandle.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index 6a047936..07e70531 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -1464,7 +1464,10 @@ class QPDFObjectHandle
static std::shared_ptr<QPDFObject>
getObject(QPDFObjectHandle& o)
{
- o.dereference();
+ if (!o.dereference()) {
+ throw std::logic_error("attempted to dereference an"
+ " uninitialized QPDFObjectHandle");
+ };
return o.obj;
}
};
@@ -1573,7 +1576,7 @@ class QPDFObjectHandle
void typeWarning(char const* expected_type, std::string const& warning);
void objectWarning(std::string const& warning);
void assertType(char const* type_name, bool istype);
- void dereference();
+ bool dereference();
void copyObject(
std::set<QPDFObjGen>& visited,
bool cross_indirect,