From 51e214aec1ec9137432233cddbe5e294bf74ca23 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Fri, 6 Jul 2018 21:10:28 +0200 Subject: statusCode might not exist --- src/client/react/components/presentational/ScheduleErrorDisplay.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/react/components/presentational/ScheduleErrorDisplay.js b/src/client/react/components/presentational/ScheduleErrorDisplay.js index 59d1f69..5072b4b 100644 --- a/src/client/react/components/presentational/ScheduleErrorDisplay.js +++ b/src/client/react/components/presentational/ScheduleErrorDisplay.js @@ -24,12 +24,17 @@ import './ScheduleErrorDisplay.scss'; class ScheduleErrorDisplay extends React.Component { static propTypes = { - statusCode: PropTypes.string.isRequired, + statusCode: PropTypes.string, }; + static defaultProps = { + statusCode: null, + } + render() { const { statusCode } = this.props; const errorMessage = ( + // statusCode might be null! statusCode === 404 ? 'Sorry, er is (nog) geen rooster voor deze week.' : 'Sorry, er is iets mis gegaan tijdens het laden van deze week.' -- cgit v1.1