mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Prevent RPC handlers from returning non-objects.
This commit is contained in:
@@ -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();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user