Skip to content

Commit 2bdfe42

Browse files
committed
Updated pdfjs image handling to support async object resolution
1 parent 0c6b23c commit 2bdfe42

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

ui-tests/cypress.config.sample.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,15 @@ module.exports = defineConfig({
7171

7272
if (doLogoCheck && args[0]) {
7373
const objName = args[0];
74-
const imgData = await page.objs.get(objName);
75-
if (!imgData) {
76-
continue;
77-
}
74+
const imgData = await new Promise((resolve) => {
75+
try {
76+
page.objs.get(objName, (data) => resolve(data));
77+
} catch (e) {
78+
resolve(null);
79+
}
80+
});
81+
82+
if (!imgData) continue;
7883

7984
const pdfImg = new PNG({ width: imgData.width, height: imgData.height });
8085
pdfImg.data = imgData.data;

0 commit comments

Comments
 (0)