Skip log in wincolor sink if out_handle_ is null

This commit is contained in:
Gabi Melman 2021-02-13 16:55:40 +02:00
parent 5efccfa5e2
commit 95c19876c6

View File

@ -58,7 +58,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::set_color(level::level_enum leve
template<typename ConsoleMutex>
void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg)
{
if (out_handle_ == INVALID_HANDLE_VALUE)
if (out_handle_ == nullptr || out_handle_ == INVALID_HANDLE_VALUE)
{
return;
}