From ecde83a28d5053ece88b043c2792c46b093910bc Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 25 Jul 2022 08:21:57 -0700 Subject: [PATCH] requesthandler: Allow empty object in Set*PrivateSettings requests Requested by #958 Closes #958 --- src/requesthandler/RequestHandler_SceneItems.cpp | 2 +- src/requesthandler/RequestHandler_Sources.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/requesthandler/RequestHandler_SceneItems.cpp b/src/requesthandler/RequestHandler_SceneItems.cpp index b60b72c3..89d59085 100644 --- a/src/requesthandler/RequestHandler_SceneItems.cpp +++ b/src/requesthandler/RequestHandler_SceneItems.cpp @@ -759,7 +759,7 @@ RequestResult RequestHandler::SetSceneItemPrivateSettings(const Request &request std::string comment; OBSSceneItemAutoRelease sceneItem = request.ValidateSceneItem("sceneName", "sceneItemId", statusCode, comment, OBS_WEBSOCKET_SCENE_FILTER_SCENE_OR_GROUP); - if (!sceneItem || !request.ValidateObject("sceneItemSettings", statusCode, comment)) + if (!sceneItem || !request.ValidateObject("sceneItemSettings", statusCode, comment, true)) return RequestResult::Error(statusCode, comment); OBSDataAutoRelease privateSettings = obs_sceneitem_get_private_settings(sceneItem); diff --git a/src/requesthandler/RequestHandler_Sources.cpp b/src/requesthandler/RequestHandler_Sources.cpp index 7aee8af2..58d91f51 100644 --- a/src/requesthandler/RequestHandler_Sources.cpp +++ b/src/requesthandler/RequestHandler_Sources.cpp @@ -339,7 +339,7 @@ RequestResult RequestHandler::SetSourcePrivateSettings(const Request &request) RequestStatus::RequestStatus statusCode; std::string comment; OBSSourceAutoRelease source = request.ValidateSource("sourceName", statusCode, comment); - if (!source || !request.ValidateObject("sourceSettings", statusCode, comment)) + if (!source || !request.ValidateObject("sourceSettings", statusCode, comment, true)) return RequestResult::Error(statusCode, comment); OBSDataAutoRelease privateSettings = obs_source_get_private_settings(source);