diff --git a/Src/WitsmlExplorer.Frontend/components/DateFormatter.ts b/Src/WitsmlExplorer.Frontend/components/DateFormatter.ts index b9466f36e..da8f7a1cb 100644 --- a/Src/WitsmlExplorer.Frontend/components/DateFormatter.ts +++ b/Src/WitsmlExplorer.Frontend/components/DateFormatter.ts @@ -55,7 +55,7 @@ export function getOffsetFromTimeZone(timeZone: TimeZone): string { } export function getOffset(dateString: string): string | null { - if (dateString.indexOf("Z") == dateString.length - 1) { + if (!dateString || dateString.indexOf("Z") == dateString.length - 1) { return "Z"; }