diff --git a/common/services/prismic/link-resolver.ts b/common/services/prismic/link-resolver.ts index 0e4e947234..074615486b 100644 --- a/common/services/prismic/link-resolver.ts +++ b/common/services/prismic/link-resolver.ts @@ -19,6 +19,9 @@ type DataProps = { }; function linkResolver(doc: Props | DataProps): string { + // this is mostly useful for scenarios like rendering in Page Builder + if (!doc) return '/'; + const { uid, type } = doc; if (!uid) return '/'; diff --git a/common/views/slices/GuideStop/index.tsx b/common/views/slices/GuideStop/index.tsx index c290da70dd..696faaf1f9 100644 --- a/common/views/slices/GuideStop/index.tsx +++ b/common/views/slices/GuideStop/index.tsx @@ -24,6 +24,7 @@ const GuideStopSlice: FunctionComponent = ({ type: 'bsl' | 'audio-without-descriptions'; exhibitionGuide: ExhibitionHighlightTour; }; + const link = number ? `${linkResolver(exhibitionGuide)}/${type}/${number}` : undefined;