return false when checking if undefined or null

This commit is contained in:
jasquat 2023-10-18 14:41:14 -04:00
parent 2f9aa12906
commit d18e54b02b
2 changed files with 6 additions and 3 deletions

View File

@ -1698,8 +1698,8 @@ export default function ProcessInstanceListTable({
};
const formatDateTime = (_row: ProcessInstance, value: any) => {
if (value === undefined) {
return undefined;
if (value === undefined || value === null) {
return value;
}
let dateInSeconds = value;
if (!isANumber(value)) {

View File

@ -353,7 +353,10 @@ export const setPageTitle = (items: Array<string>) => {
// calling it isANumber to avoid confusion with other libraries
// that have isNumber methods
export const isANumber = (str: string | number) => {
export const isANumber = (str: string | number | null) => {
if (str === undefined || str === null) {
return false;
}
return /^\d+(\.\d+)?$/.test(str.toString());
};