File tree 2 files changed +3
-3
lines changed
packages/gatsby-source-contentful
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ interface ContentfulRichTextGatsbyReference {
10
10
}
11
11
12
12
interface RenderRichTextData < T extends ContentfulRichTextGatsbyReference > {
13
- raw : string
14
- references : T [ ]
13
+ raw ? : string | null
14
+ references ? : T [ ] | null
15
15
}
16
16
17
17
export function renderRichText <
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { documentToReactComponents } from "@contentful/rich-text-react-renderer"
3
3
import resolveResponse from "contentful-resolve-response"
4
4
5
5
export function renderRichText ( { raw, references } , options = { } ) {
6
- const richText = JSON . parse ( raw )
6
+ const richText = JSON . parse ( raw || null )
7
7
8
8
// If no references are given, there is no need to resolve them
9
9
if ( ! references || ! references . length ) {
You can’t perform that action at this time.
0 commit comments