diff --git a/utils/common/conststring.h b/utils/common/conststring.h index 6813cee0a..021529bf5 100644 --- a/utils/common/conststring.h +++ b/utils/common/conststring.h @@ -33,7 +33,8 @@ class ConstString public: ConstString(const char* str, size_t length) : mStr(str), mLength(length) { - idbassert(mStr || mLength == 0); // nullptr mStr should have zero length. + if (!mStr) + mLength = 0; } explicit ConstString(const std::string& str) : mStr(str.data()), mLength(str.length()) {