aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Unresolved.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-09-08 14:03:57 +0200
committerJay Berkenbilt <ejb@ql.org>2022-09-08 16:36:39 +0200
commitdba61da1bfb7e4d74c723f369d1c017df9707a14 (patch)
tree04c51f86dc066c710c23423fe178e051b20b49d9 /libqpdf/QPDF_Unresolved.cc
parent264e25f391f83bcbeb60590f18ff96719b086454 (diff)
downloadqpdf-dba61da1bfb7e4d74c723f369d1c017df9707a14.tar.zst
Create a special "destroyed" type rather than using null
When a QPDF is destroyed, changing indirect objects to direct nulls makes them effectively disappear silently when they sneak into other places. Instead, we should treat this as an error. Adding a destroyed object type makes this possible.
Diffstat (limited to 'libqpdf/QPDF_Unresolved.cc')
-rw-r--r--libqpdf/QPDF_Unresolved.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/libqpdf/QPDF_Unresolved.cc b/libqpdf/QPDF_Unresolved.cc
index 503e5b84..79553c1e 100644
--- a/libqpdf/QPDF_Unresolved.cc
+++ b/libqpdf/QPDF_Unresolved.cc
@@ -17,7 +17,7 @@ std::shared_ptr<QPDFValueProxy>
QPDF_Unresolved::shallowCopy()
{
throw std::logic_error(
- "attempted to shallow copy unresolved QPDFObjectHandle");
+ "attempted to shallow copy an unresolved QPDFObjectHandle");
return nullptr;
}
@@ -32,5 +32,7 @@ QPDF_Unresolved::unparse()
JSON
QPDF_Unresolved::getJSON(int json_version)
{
+ throw std::logic_error(
+ "attempted to get JSON from an unresolved QPDFObjectHandle");
return JSON::makeNull();
}