mirror of
https://github.com/ppy/osu
synced 2024-12-28 09:52:56 +00:00
Fix nullref exceptions and redundant explicit type
This commit is contained in:
parent
c32ef5e718
commit
af11340849
@ -152,13 +152,13 @@ namespace osu.Game.Tests.NonVisual
|
||||
Assert.That(!host.Storage.ExistsDirectory(Path.Combine("test-nested", "cache")));
|
||||
Assert.That(storage.ExistsDirectory(Path.Combine("test-nested", "cache")));
|
||||
|
||||
foreach (var file in osuStorage.IgnoreFiles)
|
||||
foreach (var file in osuStorage?.IgnoreFiles ?? Array.Empty<string>())
|
||||
{
|
||||
Assert.That(host.Storage.Exists(file), Is.True);
|
||||
Assert.That(storage.Exists(file), Is.False);
|
||||
}
|
||||
|
||||
foreach (var dir in osuStorage.IgnoreDirectories)
|
||||
foreach (var dir in osuStorage?.IgnoreDirectories ?? Array.Empty<string>())
|
||||
{
|
||||
Assert.That(host.Storage.ExistsDirectory(dir), Is.True);
|
||||
Assert.That(storage.ExistsDirectory(dir), Is.False);
|
||||
|
@ -30,8 +30,7 @@ namespace osu.Game.Tournament.Components
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(Storage storage)
|
||||
{
|
||||
var tournamentStorage = storage as TournamentStorage;
|
||||
var stream = tournamentStorage.VideoStore.GetStream(filename);
|
||||
var stream = (storage as TournamentStorage)?.VideoStore.GetStream(filename);
|
||||
|
||||
if (stream != null)
|
||||
{
|
||||
|
@ -14,8 +14,8 @@ namespace osu.Game.IO
|
||||
/// </summary>
|
||||
public abstract class MigratableStorage : WrappedStorage
|
||||
{
|
||||
internal virtual string[] IgnoreDirectories => new string[] { };
|
||||
internal virtual string[] IgnoreFiles => new string[] { };
|
||||
internal virtual string[] IgnoreDirectories => Array.Empty<string>();
|
||||
internal virtual string[] IgnoreFiles => Array.Empty<string>();
|
||||
|
||||
protected MigratableStorage(Storage storage, string subPath = null)
|
||||
: base(storage, subPath)
|
||||
|
Loading…
Reference in New Issue
Block a user