Fix null reference in some tests due to missing realm context factory

This commit is contained in:
Dean Herbert 2021-12-15 11:16:37 +09:00
parent 441b7baa93
commit 9d85beddbe

View File

@ -43,7 +43,11 @@ namespace osu.Game.Skinning
protected Skin(SkinInfo skin, IStorageResourceProvider resources, [CanBeNull] Stream configurationStream = null)
{
SkinInfo = skin.ToLive(resources.RealmContextFactory);
SkinInfo = resources?.RealmContextFactory != null
? skin.ToLive(resources.RealmContextFactory)
// This path should only be used in some tests.
: skin.ToLiveUnmanaged();
this.resources = resources;
configurationStream ??= getConfigurationStream();