1
0
Fork 0
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:
Calixte Denizet 2021-11-12 16:17:02 +01:00
parent 3a31b7ef0c
commit 5b7e1f5232
3 changed files with 11 additions and 1 deletions

View file

@ -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;