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

Guard stringification inspector against null

parent ed544d9c
...@@ -81,13 +81,16 @@ public: ...@@ -81,13 +81,16 @@ public:
} }
inline void consume(const char* cstr) { inline void consume(const char* cstr) {
string_view tmp{cstr, strlen(cstr)}; if (cstr == nullptr) {
consume(tmp); result_ += "null";
} else {
string_view tmp{cstr, strlen(cstr)};
consume(tmp);
}
} }
inline void consume(char* cstr) { inline void consume(char* cstr) {
string_view tmp{cstr, strlen(cstr)}; consume(const_cast<const char*>(cstr));
consume(tmp);
} }
template <class T> 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