From 274558c4302cb8993d80b3524b1fd52f8f90ae4a Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 28 Sep 2019 11:39:06 +0300 Subject: [PATCH] Fix issue #1250 --- include/spdlog/sinks/wincolor_sink-inl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index 84dbbff2..72225aac 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -140,6 +140,10 @@ void SPDLOG_INLINE wincolor_sink::print_range_(const memory_buf_t template void SPDLOG_INLINE wincolor_sink::write_to_file_(const memory_buf_t &formatted) { + if(out_handle_ == nullptr) // no console and no file redirect + { + return; + } auto size = static_cast(formatted.size()); if (size == 0) {