Skip to content

Commit 5705900

Browse files
author
Toon Schoenmakers
committed
Don't create a std::string with a nullptr
1 parent aec191b commit 5705900

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/inivalue.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ class PHPCPP_EXPORT IniValue
112112
*/
113113
std::string stringValue() const
114114
{
115-
return std::string(rawValue());
115+
auto value = rawValue();
116+
return std::string(value ? value : "");
116117
}
117118

118119
/**

0 commit comments

Comments
 (0)