Skip to content

fix error handling for nil font_descriptor

Created by: jdherman

In pdf-reader the font_descriptor variable is assigned here: link

Apparently for CID fonts it will be assigned nil. This can cause problems in extract/font_metrics.rb when trying to run the ascent/descent methods on a nil object, and throws this error:

pdf-extract-0.1.1/lib/pdf/extract/font_metrics.rb:44:in `initialize': undefined method `ascent' for nil:NilClass (NoMethodError)

This will at least allow it to continue running if it encounters a CID font.

Merge request reports