FAdvancedPreviewScene profile load bug?

I’m seeing an issue reloading the preview scene profile for a custom subclass of FAdvancedPreviewScene and I noticed a suspicious line in its constructor (line 37 of AdvancedPreviewScene.cpp):

CurrentProfileIndex = DefaultSettings->Profiles.IsValidIndex(CurrentProfileIndex) ? GetDefault<UEditorPerProjectUserSettings>()->AssetViewerProfileIndex : 0;

CurrentProfile is not initialized before this line, so it seems to me that this is effectively testing a garbage value in the call to IsValidIndex. It seems like the intent here is to assign CurrentProfileIndex to `GetDefault<UEditorPerProjectUserSettings>()->AssetViewerProfileIndex` and then test if that saved index is valid, falling back to 0 if not. Am I missing something?

[Attachment Removed]

Looks like this has actually been fixed already on y’all’s main branch. Nice!

[Attachment Removed]

Hello,

Yes, it’s part of this change: https://github.com/EpicGames/UnrealEngine/commit/04b96898982ef8330074daf6c5d9f2226fc0db0b

Thanks for reporting it!

[Attachment Removed]