aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/logging.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/logging.cpp b/src/logging.cpp
index 6a7991255d..7725fefeb7 100644
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -352,7 +352,7 @@ std::string BCLog::Logger::LogTimestampStr(const std::string& str)
const auto now{SystemClock::now()};
const auto now_seconds{std::chrono::time_point_cast<std::chrono::seconds>(now)};
strStamped = FormatISO8601DateTime(TicksSinceEpoch<std::chrono::seconds>(now_seconds));
- if (m_log_time_micros) {
+ if (m_log_time_micros && !strStamped.empty()) {
strStamped.pop_back();
strStamped += strprintf(".%06dZ", Ticks<std::chrono::microseconds>(now - now_seconds));
}