Skip to content

Commit

Permalink
json: explicitly set Json::Value type to objectValue
Browse files Browse the repository at this point in the history
Proper Json::Value type would be set implicityl after the first map
element is added. That's not going when the map is empty.

Signed-off-by: Paweł Dziepak <[email protected]>
  • Loading branch information
pdziepak committed Jul 9, 2015
1 parent 290804b commit da52b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion json.hh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace json {

template<typename Map>
inline sstring to_json(const Map& map) {
Json::Value root;
Json::Value root(Json::objectValue);
for (auto&& kv : map) {
root[kv.first] = Json::Value(kv.second);
}
Expand Down

0 comments on commit da52b5d

Please sign in to comment.