From c1c316b379ffe3916d9186872cf98f8edbadc970 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 4 Jan 2020 14:02:54 -0800 Subject: [PATCH] fix: Error loading share link view. closes #1143 --- app/scenes/Document/KeyedDocument.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ; }