aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Array.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDF_Array.cc')
-rw-r--r--libqpdf/QPDF_Array.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libqpdf/QPDF_Array.cc b/libqpdf/QPDF_Array.cc
index 12e4b3e9..de34103e 100644
--- a/libqpdf/QPDF_Array.cc
+++ b/libqpdf/QPDF_Array.cc
@@ -123,8 +123,12 @@ void
QPDF_Array::setFromVector(std::vector<std::shared_ptr<QPDFObject>>&& v)
{
this->elements = SparseOHArray();
- for (auto&& iter: v) {
- this->elements.append(iter);
+ for (auto&& item: v) {
+ if (item) {
+ this->elements.append(item);
+ } else {
+ ++this->elements.n_elements;
+ }
}
}