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
1 changed files with 5 additions and 1 deletions

View File

@ -43,7 +43,11 @@ public abstract class Skin : IDisposable, ISkin
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();