mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
XFA - Avoid an exception when looking for a font in a parent node
- it aims to fix issue https://github.com/mozilla/pdf.js/issues/14150; - a parent can be null in case the root has been reached, so just add a check.
This commit is contained in:
parent
3a31b7ef0c
commit
5b7e1f5232
3 changed files with 11 additions and 1 deletions
|
@ -238,7 +238,7 @@ function layoutNode(node, availableSpace) {
|
|||
if (!font) {
|
||||
const root = node[$getTemplateRoot]();
|
||||
let parent = node[$getParent]();
|
||||
while (parent !== root) {
|
||||
while (parent && parent !== root) {
|
||||
if (parent.font) {
|
||||
font = parent.font;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue