Skip to content

Commit 5207585

Browse files
committed
Fix broken rendering
cast to `as string` hides the fact that lang can be undefined- not cool.
1 parent 212c014 commit 5207585

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/command/render/render-files.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,12 @@ export async function renderFiles(
330330
// Set the date locale for this render
331331
// Used for date formatting
332332
initDayJsPlugins();
333-
await setDateLocale(context.format.metadata[kLang] as string);
333+
if (
334+
context.format.metadata[kLang] &&
335+
typeof (context.format.metadata[kLang]) === "string"
336+
) {
337+
await setDateLocale(context.format.metadata[kLang] as string);
338+
}
334339

335340
const fileLifetime = createNamedLifetime("render-file");
336341
fileLifetime.attach({

0 commit comments

Comments
 (0)