Skip to content

Commit a36cd0e

Browse files
committed
[FIX] UI issue with IOC without TLPs
1 parent 06e1829 commit a36cd0e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

source/app/datamgmt/case/case_iocs_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def get_detailed_iocs(caseid):
146146
IocLink.ioc_id == Ioc.ioc_id)
147147
).join(IocLink.ioc)
148148
.join(Ioc.ioc_type)
149-
.join(Ioc.tlp)
149+
.outerjoin(Ioc.tlp)
150150
.order_by(IocType.type_name).all())
151151

152152
return detailed_iocs

source/app/static/assets/js/iris/case.ioc.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,12 @@ $(document).ready(function(){
433433
"data": "tlp_name",
434434
"render": function(data, type, row, meta) {
435435
if (type === 'display') {
436-
data = sanitizeHTML(data);
437-
data = '<span class="badge badge-'+ row['tlp_bscolor'] +' ml-2">tlp:' + data + '</span>';
436+
if (data) {
437+
data = sanitizeHTML(data);
438+
data = '<span class="badge badge-' + row['tlp_bscolor'] + ' ml-2">tlp:' + data + '</span>';
439+
} else {
440+
return `<span class="badge badge-light ml-2">unspecified</span>`
441+
}
438442
}
439443
return data;
440444
}

0 commit comments

Comments
 (0)