Skip to content

Commit 0a36c05

Browse files
committed
Fix program pagination: add fallback for to prevent GraphQL null errors
1 parent 4256532 commit 0a36c05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gatsby-node.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,17 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
460460

461461

462462
programs.forEach((program) => {
463+
const programName = program.frontmatter.program || "default-program";
463464
envCreatePage({
464465
path: `/programs/${program.frontmatter.programSlug}`,
465466
component: `${MultiProgramPostTemplate}?__contentFilePath=${program.internal.contentFilePath}`,
466467
context: {
467-
program: program.frontmatter.program,
468+
program: programName,
468469
},
469470
});
470471
});
471472

473+
472474
if (!isFullSiteBuild) {
473475
const litePlaceholderPages = [
474476
{

0 commit comments

Comments
 (0)