From 03ec7424023cefdc276f273a1a92e148bbb7c698 Mon Sep 17 00:00:00 2001 From: Sparticuz Date: Fri, 30 Dec 2022 11:28:52 -0500 Subject: [PATCH] font should return a promise with null here, instead of just null --- source/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/index.ts b/source/index.ts index b2e1209..b7c7769 100644 --- a/source/index.ts +++ b/source/index.ts @@ -52,11 +52,13 @@ if ( process.env.AWS_EXECUTION_ENV !== undefined && /^AWS_Lambda_nodejs(?:14|16| class Chromium { /** * Downloads or symlinks a custom font and returns its basename, patching the environment so that Chromium can find it. - * If not running on AWS Lambda nor Google Cloud Functions, `null` is returned instead. + * If headless is not true, `null` is returned instead. */ - static font(input: string): Promise { + static font(input: string): Promise { if (Chromium.headless !== true) { - return null; + return new Promise((resolve) => { + return resolve(null); + }); } if (process.env.HOME === undefined) {