diff --git a/lib/combine_pdf/parser.rb b/lib/combine_pdf/parser.rb index 27c06d4..2689750 100644 --- a/lib/combine_pdf/parser.rb +++ b/lib/combine_pdf/parser.rb @@ -323,8 +323,8 @@ def _parse_ str << 12 when 48..57 # octal notation for byte? rep -= 48 - rep = (rep << 3) + (str_bytes.shift-48) if str_bytes[0].between?(48, 57) - rep = (rep << 3) + (str_bytes.shift-48) if str_bytes[0].between?(48, 57) && (((rep << 3) + (str_bytes[0] - 48)) <= 255) + rep = (rep << 3) + (str_bytes.shift-48) if str_bytes[0]&.between?(48, 57) + rep = (rep << 3) + (str_bytes.shift-48) if str_bytes[0]&.between?(48, 57) && (((rep << 3) + (str_bytes[0] - 48)) <= 255) str << rep when 10 # new line, ignore str_bytes.shift if str_bytes[0] == 13