[Debugger] Fix the content stream rendering when it's a ref to an array

It can be verified in opening stepped.pdf (see #21089).
This commit is contained in:
calixteman 2026-04-12 13:40:13 +02:00
parent 5089cceec7
commit 5cc5d9be45
No known key found for this signature in database
GPG Key ID: 0C5442631EE0691F
2 changed files with 5 additions and 2 deletions

View File

@ -316,7 +316,10 @@ const InternalViewerUtils = {
},
getContentTokens(contentsVal, xref) {
const refs = Array.isArray(contentsVal) ? contentsVal : [contentsVal];
// Contents may be a Ref to a stream, a direct array of Refs, or a Ref to
// an array of Refs. Resolve one level to detect the array case.
const resolvedVal = xref.fetchIfRef(contentsVal);
const refs = Array.isArray(resolvedVal) ? resolvedVal : [contentsVal];
const rawContents = [];
const tokens = [];
const rawBytesArr = [];

View File

@ -196,7 +196,7 @@ class NetworkPdfManager extends BasePdfManager {
try {
const value = obj[prop];
if (typeof value === "function") {
return value.apply(obj, args);
return await value.apply(obj, args);
}
return value;
} catch (ex) {