From 1ca999fdb58558171166e0dfbe10e10b374d3e33 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 2 Aug 2018 08:01:17 -0400 Subject: [PATCH] FIX: formats topic report only if we have one (#6231) --- app/assets/javascripts/admin/models/report.js.es6 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/models/report.js.es6 b/app/assets/javascripts/admin/models/report.js.es6 index c071589c19b..fc4fb8e86af 100644 --- a/app/assets/javascripts/admin/models/report.js.es6 +++ b/app/assets/javascripts/admin/models/report.js.es6 @@ -324,12 +324,16 @@ const Report = Discourse.Model.extend({ _topicLabel(properties, row) { const topicTitle = row[properties.title]; - const topicId = row[properties.id]; - const href = `/t/-/${topicId}`; + + const formatedValue = () => { + const topicId = row[properties.id]; + const href = `/t/-/${topicId}`; + return `${topicTitle}`; + }; return { value: topicTitle, - formatedValue: `${topicTitle}` + formatedValue: topicTitle ? formatedValue() : "-" }; },