UI: Fix crash when creating scene collections with "unsafe" names #11301
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes possible crash when a new scene collection is created with a name that consists "unsafe" characters.
Motivation and Context
Scene collection names that are not considered "safe" by OBS Studio get a changed JSON file name with incompatible characters replaced.
The refactored scene collection implementation uses the
Load
function to either activate an existing scene collection or create a new one if it does not exist.The
Load
function however overwrote the scene collection name set in the profile with its own variant based off the "safe" file name, which created a mismatch with the code that created the collection data model.As the
Load
function is only called byActivateSceneCollection
(which itself already sets the name and filename for the collection), removal of this superfluous code in the Load function also fixes the issue.How Has This Been Tested?
Tested on Windows 11 with a scene collection named "New Collection" which will be automatically stored in "New_Collection.json".
Types of changes
Checklist: