diff --git a/app/scenes/Document/KeyedDocument.js b/app/scenes/Document/KeyedDocument.js index 116e14d5d..e6452288f 100644 --- a/app/scenes/Document/KeyedDocument.js +++ b/app/scenes/Document/KeyedDocument.js @@ -9,13 +9,13 @@ class KeyedDocument extends React.Component<*> { } render() { - const { match } = this.props; + const { documentSlug } = this.props.match.params; // the urlId portion of the url does not include the slugified title // we only want to force a re-mount of the document component when the // document changes, not when the title does so only this portion is used // for the key. - const urlId = match.params.documentSlug.split('-')[1]; + const urlId = documentSlug ? documentSlug.split('-')[1] : undefined; return ; }