Ignore possible path-related nulls

They're all in test code anyway, so any issue there will cause a test to
fail.
This commit is contained in:
Bartłomiej Dach
2021-05-14 23:50:25 +02:00
parent fa6b5515b7
commit b51d038088
3 changed files with 6 additions and 3 deletions

View File

@ -5,6 +5,7 @@ using System;
using System.IO;
using System.Reflection;
using NUnit.Framework;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Formats;
using osu.Game.IO;
@ -41,7 +42,7 @@ namespace osu.Game.Tests.Beatmaps
private Stream openResource(string name)
{
var localPath = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path));
var localPath = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)).AsNonNull();
return Assembly.LoadFrom(Path.Combine(localPath, $"{ResourceAssembly}.dll")).GetManifestResourceStream($@"{ResourceAssembly}.Resources.{name}");
}