[www] Fixed an issue with 500 error on undefined article
This commit is contained in:
1 parent
892e270c99
commit
91ace41345
1 file changed
+5
-5
@@ -142,12 +142,12 @@ function getArticle() {
|
|||||||
const path = getPathWithNoTrailingSlash(ctx.path)
|
const path = getPathWithNoTrailingSlash(ctx.path)
|
||||||
const article = await findArticle(id)
|
const article = await findArticle(id)
|
||||||
|
|
||||||
const previewId = article.preview
|
|
||||||
? article.preview
|
|
||||||
: article.images[0]
|
|
||||||
article.preview = await Image.findById(previewId)
|
|
||||||
|
|
||||||
if (article) {
|
if (article) {
|
||||||
|
const previewId = article.preview
|
||||||
|
? article.preview
|
||||||
|
: article.images[0]
|
||||||
|
article.preview = await Image.findById(previewId)
|
||||||
|
|
||||||
const Component = (
|
const Component = (
|
||||||
<div className="content content_thin">
|
<div className="content content_thin">
|
||||||
<Article
|
<Article
|
||||||
|
|||||||
Reference in new issue
Block a user