From a5a39c52b05647266facf41961e9270212b4ad44 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 19 Oct 2018 02:45:35 +0300 Subject: [PATCH] Added nullptr check to append_string_view --- include/spdlog/details/fmt_helper.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/spdlog/details/fmt_helper.h b/include/spdlog/details/fmt_helper.h index 0e606518..4de48899 100644 --- a/include/spdlog/details/fmt_helper.h +++ b/include/spdlog/details/fmt_helper.h @@ -24,7 +24,10 @@ template inline void append_string_view(fmt::string_view view, fmt::basic_memory_buffer &dest) { auto *buf_ptr = view.data(); - dest.append(buf_ptr, buf_ptr + view.size()); + if(buf_ptr != nullptr) + { + dest.append(buf_ptr, buf_ptr + view.size()); + } } template