diff --git a/osu.Game/Skinning/MaxDimensionLimitedTextureLoaderStore.cs b/osu.Game/Skinning/MaxDimensionLimitedTextureLoaderStore.cs index 94d7afaf7e..503add45ed 100644 --- a/osu.Game/Skinning/MaxDimensionLimitedTextureLoaderStore.cs +++ b/osu.Game/Skinning/MaxDimensionLimitedTextureLoaderStore.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using System.IO; @@ -17,9 +15,9 @@ namespace osu.Game.Skinning { public class MaxDimensionLimitedTextureLoaderStore : IResourceStore { - private readonly IResourceStore textureStore; + private readonly IResourceStore? textureStore; - public MaxDimensionLimitedTextureLoaderStore(IResourceStore textureStore) + public MaxDimensionLimitedTextureLoaderStore(IResourceStore? textureStore) { this.textureStore = textureStore; } @@ -60,10 +58,12 @@ public TextureUpload Get(string name) return textureUpload; } - public Task GetAsync(string name, CancellationToken cancellationToken = new CancellationToken()) => textureStore?.GetAsync(name, cancellationToken); + // TODO: remove null-forgiving operator below after texture stores are NRT-annotated framework-side + public Task GetAsync(string name, CancellationToken cancellationToken = new CancellationToken()) + => textureStore?.GetAsync(name, cancellationToken) ?? Task.FromResult(null!); - public Stream GetStream(string name) => textureStore?.GetStream(name) ?? default; + public Stream? GetStream(string name) => textureStore?.GetStream(name); - public IEnumerable GetAvailableResources() => textureStore?.GetAvailableResources(); + public IEnumerable GetAvailableResources() => textureStore?.GetAvailableResources() ?? Array.Empty(); } }