Commit 318e5bd1 authored by Dominik Charousset's avatar Dominik Charousset

Guard stringification inspector against null

parent ed544d9c
......@@ -81,13 +81,16 @@ public:
}
inline void consume(const char* cstr) {
string_view tmp{cstr, strlen(cstr)};
consume(tmp);
if (cstr == nullptr) {
result_ += "null";
} else {
string_view tmp{cstr, strlen(cstr)};
consume(tmp);
}
}
inline void consume(char* cstr) {
string_view tmp{cstr, strlen(cstr)};
consume(tmp);
consume(const_cast<const char*>(cstr));
}
template <class T>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment