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

@ -9,6 +9,7 @@ using System.Reflection;
using Newtonsoft.Json;
using NUnit.Framework;
using osu.Framework.Audio.Track;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics.Textures;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Formats;
@ -164,7 +165,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}");
}