Prevent RPC handlers from returning non-objects.

This commit is contained in:
Tom Ritchford
2015-01-13 10:47:35 -05:00
parent 743bd6c917
commit 6c2d60cec2

View File

@@ -32,6 +32,12 @@ Handler::Method<Json::Value> byRef (Function const& f)
return [f] (Context& context, Json::Value& result)
{
result = f (context);
if (result.type() != Json::objectValue)
{
assert (false);
result = RPC::makeObjectValue (result);
}
return Status();
};
}