Skip to content

Commit

Permalink
Fixes NaN values not correctly checked
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoBiscosi committed May 11, 2024
1 parent 8489c19 commit a02dd13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
19 changes: 3 additions & 16 deletions http_src/vue/page-open-ports.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { ref, onBeforeMount, onMounted } from "vue";
import { default as TableWithConfig } from "./table-with-config.vue";
import { ntopng_url_manager } from "../services/context/ntopng_globals_services.js";
import { ntopng_utility } from '../services/context/ntopng_globals_services';
import dataUtils from '../utilities/data-utils';
/* ******************************************************************** */
Expand Down Expand Up @@ -188,12 +189,9 @@ function columns_sorting(col, r0, r1) {
}
function format_cve_num(num) {
let value = 0;
if (num === "" || num === null || num === NaN || num === undefined) {
if (dataUtils.isEmptyOrNull(num) || isNaN(value)) {
value = 0;
} else {
num = num.split(',').join("");
Expand All @@ -203,19 +201,8 @@ function format_cve_num(num) {
return value;
}
function format_num_for_sort(num) {
if (num === "" || num === null || num === NaN || num === undefined) {
num = 0;
} else {
num = num.split(',').join("")
num = parseInt(num);
}
return num;
}
function format_num_ports_for_sort(num) {
if (num == "" || num == null || num == NaN || num == undefined)
if (dataUtils.isEmptyOrNull(num) || isNaN(value))
num = 0;
num = parseInt(num);;
Expand Down
2 changes: 1 addition & 1 deletion httpdocs/dist
Submodule dist updated 1 files
+2 −2 ntopng.js

0 comments on commit a02dd13

Please sign in to comment.