Skip to content

Commit ed77043

Browse files
fix: CS8766 TrackingStore nullable return type mismatch in test
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/7feb0b51-f140-4b4b-a529-97773ce2018a Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 45ddb9e commit ed77043

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

osu.Game.Tests/IO/OptimisedMediaResourceStoreTest.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,20 @@ public TrackingStore(Dictionary<string, byte[]> resources)
9595
this.resources = resources;
9696
}
9797

98-
public byte[]? Get(string name)
98+
public byte[] Get(string name)
9999
{
100100
RequestedNames.Add(name);
101-
return resources.GetValueOrDefault(name);
101+
return resources.GetValueOrDefault(name)!;
102102
}
103103

104-
public Task<byte[]?> GetAsync(string name, CancellationToken cancellationToken = default)
104+
public Task<byte[]> GetAsync(string name, CancellationToken cancellationToken = default)
105105
=> Task.FromResult(Get(name));
106106

107107
public Stream? GetStream(string name)
108108
{
109-
byte[]? data = Get(name);
110-
return data == null ? null : new MemoryStream(data);
109+
RequestedNames.Add(name);
110+
byte[]? data = resources.GetValueOrDefault(name);
111+
return data != null ? new MemoryStream(data) : null;
111112
}
112113

113114
public IEnumerable<string> GetAvailableResources() => resources.Keys;

0 commit comments

Comments
 (0)