Skip to content

Commit 4609e1f

Browse files
machourHoussein Djirdeh
authored andcommitted
fix(crash): Fix potential crash on undefined parent in <code> (#662)
1 parent 14532ce commit 4609e1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/github-htmlview.component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export class GithubHtmlView extends Component {
243243
<View key={index}>{defaultRenderer(node.children, node)}</View>
244244
),
245245
code: (node, index, siblings, parent, defaultRenderer) => {
246-
if (parent.name === 'pre') {
246+
if (parent && parent.name === 'pre') {
247247
return (
248248
<SyntaxHighlighter
249249
key={index}

0 commit comments

Comments
 (0)