From 95c19876c68b62b229acae7b73ee419a0797cd6d Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Sat, 13 Feb 2021 16:55:40 +0200 Subject: [PATCH] Skip log in wincolor sink if out_handle_ is null --- include/spdlog/sinks/wincolor_sink-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index 859c4eea..59f1d4f4 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -58,7 +58,7 @@ void SPDLOG_INLINE wincolor_sink::set_color(level::level_enum leve template void SPDLOG_INLINE wincolor_sink::log(const details::log_msg &msg) { - if (out_handle_ == INVALID_HANDLE_VALUE) + if (out_handle_ == nullptr || out_handle_ == INVALID_HANDLE_VALUE) { return; }