diff --git a/src/common/strings/formatting.h b/src/common/strings/formatting.h index 43cb118f2..9eaf644f8 100644 --- a/src/common/strings/formatting.h +++ b/src/common/strings/formatting.h @@ -31,6 +31,8 @@ template std::string format_timestamp(basic_timestamp_c const ×tamp, unsigned int precision = 9) { + if (!timestamp.valid()) + return ""; return format_timestamp(timestamp.to_ns(), precision); } @@ -38,6 +40,8 @@ template std::string format_timestamp(basic_timestamp_c const ×tamp, std::string const &format) { + if (!timestamp.valid()) + return ""; return format_timestamp(timestamp.to_ns(), format); }