Skip to content

Commit 48ba2c0

Browse files
314systemsCopilot
andcommitted
refactor: replace non-null assertions with optional chaining in vercel-og font patch
Co-authored-by: Copilot <[email protected]>
1 parent 9314fd8 commit 48ba2c0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/cloudflare/src/cli/build/patches/ast/patch-vercel-og-library.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ export function patchVercelOgLibrary(buildOpts: BuildOptions): boolean {
6565
writeFileSync(outputEdgePath, ast.commitEdits(edits));
6666

6767
if (matches.length > 0) {
68-
const fontFileName = matches[0]!.getMatch("PATH")!.text();
69-
renameSync(path.join(outputDir, fontFileName), path.join(outputDir, `${fontFileName}.bin`));
68+
const fontFileName = matches[0]?.getMatch("PATH")?.text();
69+
if (fontFileName) {
70+
renameSync(path.join(outputDir, fontFileName), path.join(outputDir, `${fontFileName}.bin`));
71+
}
7072
}
7173
}
7274

0 commit comments

Comments
 (0)