Hey everyone!
Context
I’m creating a subclass of UDeveloperSettings called UMusicSettings, where I can set the default playlist of songs. The only variable that I want to set this way is called DefaultPlaylist. When I go to set DefaultPlaylist through the project settings, it looks like this..
The Issue
As soon as I click the data asset I want, the editor crashes and throws this as it’s only error..
Error LogWindows appError called: Assertion failed: (Index >= 0) & (Index < ArrayNum) \[File:D:\\build++UE5\\Sync\\Engine\\Source\\Runtime\\Core\\Public\\Containers\\Array.h\] \[Line: 783\]
Error LogWindows Array index out of bounds: 0 into an array of size 0
The Music Settings Class
The MusicSettings class is very short..
#pragma once
#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "MusicSettings.generated.h"
class USongCollection;
UCLASS(Config="Game", DefaultConfig)
class ELDERWILD_API UMusicSettings : public UDeveloperSettings
{
GENERATED_BODY()
public:
// Find the settings under Project Settings -> Game -> Music
virtual FName GetCategoryName() const override { return "Game"; }
UPROPERTY(EditAnywhere, Category="Music")
USongCollection* DefaultPlaylist = nullptr;
};
Note that removing the forward declaration in favour of directly including the USongCollection class made no difference here.
Debugging & Additional Info
I’m really thrown off by the array indexing error here, there isn’t a single TArray in UMusicSettings (UDeveloperSettings), USongCollection (UDataAsset) or USong (UDataAsset)
None of the data assets are empty, but in my mind that shouldn’t even matter as I’m not getting to the point where I can do anything with the information inside of the data assets.
Is there something wrong with the MusicSettings class declaration or macro specifiers that I’m not seeing? Is there more setup needed than just declaring this class and going to the project settings?
There is another path I can go down, which is to just pass the SongCollection data asset to some actor and the actor can feed the playlist information to wherever it is needed. I’d like to avoid this if it’s possible, as it seems like bad design to create an actor in the world just to pass information from the editor to a UGameInstanceSubsystem, which is where I want to process the information from the data asset.
Please let me know what I’m missing or if more information is needed and thank you for your help!
Updates
The Rider debugger shows this as it’s final error..
Which looks like an error from de-referencing a nullptr
The last function to be called was this..
UObject::SaveConfig(unsigned __int64,wchar_t const * __ptr64,FConfigCacheIni * __ptr64,bool) __ptr64

