Ensure that "local" /Contents stream-dict /Resources aren't empty (PR 19803 follow-up)

This is a small, and quite possibly pointless, optimization which ensures that any "local" /Resources aren't empty, to avoid needlessly trying to load and merge dictionaries.
This commit is contained in:
Jonas Jenwald 2025-04-14 09:58:15 +02:00
parent 2f7d163dfd
commit 245d9ba925

View File

@ -427,7 +427,7 @@ class Page {
// available (see issue18894.pdf).
const localResources = streamDict?.get("Resources");
if (!(localResources instanceof Dict)) {
if (!(localResources instanceof Dict && localResources.size)) {
return this.resources;
}
const objectLoader = new ObjectLoader(localResources, keys, this.xref);