Skip to content

Commit 38366be

Browse files
committed
Check if section prop is defined
1 parent 071e276 commit 38366be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/Section.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ class Section extends Component {
2222
}
2323

2424
componentDidMount() {
25-
this.viewedSection(get(this, 'props.section.id'))
25+
if (this.props.section) {
26+
this.viewedSection(this.props.section.id)
27+
}
2628
}
2729

2830
componentDidUpdate(prevProps) {

0 commit comments

Comments
 (0)