diff --git a/Userland/Libraries/LibPDF/Fonts/Type0Font.cpp b/Userland/Libraries/LibPDF/Fonts/Type0Font.cpp index 4742925965..714be2ebce 100644 --- a/Userland/Libraries/LibPDF/Fonts/Type0Font.cpp +++ b/Userland/Libraries/LibPDF/Fonts/Type0Font.cpp @@ -134,12 +134,7 @@ PDFErrorOr Type0Font::initialize(Document* document, NonnullRefPtrat(i); if (!pending_code.has_value()) { pending_code = value.to_int(); - } else if (value.has>()) { - auto array = value.get>()->cast(); - auto code = pending_code.release_value(); - for (auto& width : *array) - widths.set(code++, width.to_int()); - } else { + } else if (value.has_number()) { auto first_code = pending_code.release_value(); auto last_code = value.to_int(); auto width = widths_array->at(i + 1).to_int(); @@ -147,6 +142,11 @@ PDFErrorOr Type0Font::initialize(Document* document, NonnullRefPtr>()->cast(); + auto code = pending_code.release_value(); + for (auto& width : *array) + widths.set(code++, width.to_int()); } } }