Requests: Check for last scene in RemoveScene

This commit is contained in:
tt2468 2021-09-01 10:43:36 -07:00
parent 8a45560297
commit 9a8587d6df

View File

@ -95,6 +95,9 @@ RequestResult RequestHandler::RemoveScene(const Request& request)
if (!scene)
return RequestResult::Error(statusCode, comment);
if (Utils::Obs::NumberHelper::GetSceneCount() < 2)
return RequestResult::Error(RequestStatus::NotEnoughResources, "You cannot remove the last scene in the collection.");
obs_source_remove(scene);
return RequestResult::Success();