aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QPDFObjectHandle.hh
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-06-25 16:59:39 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-06-27 16:39:04 +0200
commit5aa8225f493dc3c3171662fecc8a9ff5d0a16feb (patch)
treefb7bd82e238f02e92a5bf7324909e169ec018951 /include/qpdf/QPDFObjectHandle.hh
parent0c7c7e4ba485fd39f5b6d41fa2924c607d2eeda0 (diff)
downloadqpdf-5aa8225f493dc3c3171662fecc8a9ff5d0a16feb.tar.zst
Refactor QPDFObjectTypeAccessor and QPDFObjectHandle::dereference
Diffstat (limited to 'include/qpdf/QPDFObjectHandle.hh')
-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,