mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Request: Consider null parameters missing
This commit is contained in:
parent
bc1dc807e4
commit
4f804baf95
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
json GetDefaultJsonObject(json requestData)
|
json GetDefaultJsonObject(json requestData)
|
||||||
{
|
{
|
||||||
|
// Always provide an object to prevent exceptions while running checks in requests
|
||||||
if (!requestData.is_object())
|
if (!requestData.is_object())
|
||||||
return json::object();
|
return json::object();
|
||||||
else
|
else
|
||||||
@ -26,7 +27,7 @@ const bool Request::ValidateBasic(const std::string keyName, RequestStatus::Requ
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RequestData.contains(keyName)) {
|
if (!RequestData.contains(keyName) || RequestData[keyName].is_null()) {
|
||||||
statusCode = RequestStatus::MissingRequestParameter;
|
statusCode = RequestStatus::MissingRequestParameter;
|
||||||
comment = std::string("Your request is missing the `") + keyName + "` parameter.";
|
comment = std::string("Your request is missing the `") + keyName + "` parameter.";
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user