diff --git a/lib/combine_pdf/renderer.rb b/lib/combine_pdf/renderer.rb
index <HASH>..<HASH> 100644
--- a/lib/combine_pdf/renderer.rb
+++ b/lib/combine_pdf/renderer.rb
@@ -107,7 +107,7 @@ module CombinePDF
         end
       end
       # remove extra page references.
-      object[:Contents].delete(is_reference_only: true, referenced_object: { indirect_reference_id: 0, raw_stream_content: '' }) if object[:Type] == :Page && object[:Contents]
+      object[:Contents].delete(is_reference_only: true, referenced_object: { indirect_reference_id: 0, raw_stream_content: '' }) if object[:Type] == :Page && object[:Contents].is_a?(Array)
       # correct stream length, if the object is a stream.
       object[:Length] = object[:raw_stream_content].bytesize if object[:raw_stream_content]
object[:Contents] needs to be an Array

This line is used to remove "empty" edits to PDF pages. This means that pages were expected to have data added to them but where eventually left alone (or the data added was another PDF page instead of a text object).