From 2b4998a122de12850509b4c12430266368430a00 Mon Sep 17 00:00:00 2001 From: Daniel Lim Wee Soong Date: Sat, 17 Mar 2018 22:55:57 +0800 Subject: [PATCH] Add check if filter is not a nullptr Fix segfault and pass tests --- src/common/logging/backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 3c0361713c..0400a3282f 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -140,7 +140,7 @@ void SetFilter(Filter* new_filter) { void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num, const char* function, const char* format, ...) { - if (!filter->CheckMessage(log_class, log_level)) + if (filter != nullptr && !filter->CheckMessage(log_class, log_level)) return; std::array formatting_buffer; va_list args;