Null check in comment field

This commit is contained in:
Ian Renton
2025-10-03 14:11:29 +01:00
parent 5ac1697e08
commit 7afedf2315

View File

@@ -101,6 +101,12 @@ function updateTable() {
mode_string = mode_string + "<span class='mode-q'><i class='fa-solid fa-circle-question' title='The mode was not reported via the spotting service. This is a guess based on the frequency.'></i></span>"
}
// Format comment
var commentText = "";
if (s["comment"] != null) {
commentText = escapeHtml(s["comment"]);
}
// Format sig_refs
var sig_refs = ""
if (s["sig_refs"]) {
@@ -129,7 +135,7 @@ function updateTable() {
$tr.append(`<td class='nowrap'><span class='flag-wrapper' title='${dx_country}'>${s["dx_flag"]}</span><a class='dx-link' href='https://qrz.com/db/${s["dx_call"]}' target='_new'>${s["dx_call"]}</a></td>`);
$tr.append(`<td class='nowrap'><span class='band-bullet band-bullet-${cssFormattedBandName}' title='${bandFullName}'>&#9632;</span>${freq_string}</td>`);
$tr.append(`<td class='nowrap'>${mode_string}</td>`);
$tr.append('<td>' + escapeHtml(`${s["comment"]}`) + '</td>');
$tr.append(`<td>${commentText}</td>`);
$tr.append(`<td class='nowrap'><span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${s["source"]}</td>`);
$tr.append(`<td class='nowrap'>${sig_refs}</td>`);
$tr.append(`<td class='nowrap'><span class='flag-wrapper' title='${de_country}'>${de_flag}</span>${s["de_call"]}</td>`);