Skip to content

Commit

Permalink
fix undefined variable for invalid font error
Browse files Browse the repository at this point in the history
fixes #316
  • Loading branch information
rkusa committed Dec 27, 2023
1 parent f0e9560 commit b70e215
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed `Name must start with a leading slash` when adding an external document to a `pdfjs` document, and adding that result to another `pdfjs` document again (caused by a `null` object reference due to object streams). Also fixes duplicate objects when adding external documents with
pages in object streams.
- Fixed TypeScript type definition of `doc.asBuffer` and `doc.width`/`doc.height`
- Fixed referencing an undefined variable when throw an invalid font error

## [2.5.2]
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion lib/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Text = (module.exports = class Text extends Fragment {
this._parts--;

if (!Font.isFont(opts.font || this.defaultFont)) {
throw new TypeError("invalid font: " + font);
throw new TypeError("invalid font");
}

const font = this._doc._fontInstance(opts.font || this.defaultFont);
Expand Down

0 comments on commit b70e215

Please sign in to comment.