From ec08d0293d0ade8ac2a99aa42c85ec4234e8a07a Mon Sep 17 00:00:00 2001 From: kylegalbraith Date: Mon, 10 Jul 2023 12:38:49 +0200 Subject: [PATCH] defense against message being null --- src/depot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/depot.ts b/src/depot.ts index c912d80..5211280 100644 --- a/src/depot.ts +++ b/src/depot.ts @@ -147,7 +147,7 @@ export async function build(inputs: Inputs) { env: {...process.env, ...(token ? {DEPOT_TOKEN: token} : {})}, }) } catch (err) { - const lintFailed = inputs.lint && (err as Error).message.includes('linting failed') + const lintFailed = inputs.lint && (err as Error).message?.includes('linting failed') if (inputs.buildxFallback && !lintFailed) { core.warning(`falling back to buildx: ${err}`) await execBuild('docker', ['buildx', 'build', ...buildxArgs, resolvedContext])