Skip to content

Commit

Permalink
Don't create a std::string with a nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
Toon Schoenmakers committed Dec 8, 2015
1 parent aec191b commit 5705900
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/inivalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ class PHPCPP_EXPORT IniValue
*/
std::string stringValue() const
{
return std::string(rawValue());
auto value = rawValue();
return std::string(value ? value : "");
}

/**
Expand Down

0 comments on commit 5705900

Please sign in to comment.