{[values.content.trim()]}', + '
{[values.content?.trim()]}', '
From 5900469e25c06fbfae1f1607794c1369cdf5bf45 Mon Sep 17 00:00:00 2001 From: csmig <33138761+csmig@users.noreply.github.com> Date: Wed, 21 Jul 2021 21:13:46 -0400 Subject: [PATCH] fix: UI now handles missing vulnDiscussion (#361) --- api/source/service/mysql/STIGService.js | 9 +-------- clients/extjs/js/review.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/api/source/service/mysql/STIGService.js b/api/source/service/mysql/STIGService.js index e8028912a..d4ca65f3c 100644 --- a/api/source/service/mysql/STIGService.js +++ b/api/source/service/mysql/STIGService.js @@ -271,14 +271,7 @@ exports.queryBenchmarkRules = async function ( benchmarkId, revisionStr, inProje sql += ` order by substring(r.ruleId from 4) + 0` try { - let formatted = dbUtils.pool.format(sql, predicates.binds) - let [rows, fields] = await dbUtils.pool.query(sql, predicates.binds) - for (let x = 0, l = rows.length; x < l; x++) { - let record = rows[x] - // remove keys with null value - Object.keys(record).forEach(key => record[key] == null && delete record[key]) - } - + let [rows] = await dbUtils.pool.query(sql, predicates.binds) return (rows) } catch (err) { diff --git a/clients/extjs/js/review.js b/clients/extjs/js/review.js index bfabd8820..198c9b103 100644 --- a/clients/extjs/js/review.js +++ b/clients/extjs/js/review.js @@ -795,24 +795,26 @@ async function addReview( params ) { '
{[values.content.trim()]}', + '
{[values.content?.trim()]}', '
{[values.text.trim()]}', + '
{[values.text?.trim()]}', '
{[values.vulnDiscussion.trim()]}', - '
{[values.vulnDiscussion?.trim()]}', + '