Fix nullability warnings in PathExtensions
Definitely not happy with any of this
This commit is contained in:
parent
8ae01f2f42
commit
f022954554
|
@ -78,6 +78,7 @@ namespace BizHawk.Common.PathExtensions
|
|||
|
||||
// zero 06-nov-2015 - regarding the below, i changed my mind. for libretro i want subdirectories here.
|
||||
var filesystemDir = Path.GetDirectoryName(filesystemSafeName);
|
||||
if (string.IsNullOrEmpty(filesystemDir)) throw new Exception();
|
||||
filesystemSafeName = Path.GetFileName(filesystemSafeName);
|
||||
|
||||
filesystemSafeName = filesystemSafeName.RemoveInvalidFileSystemChars();
|
||||
|
@ -114,7 +115,8 @@ namespace BizHawk.Common.PathExtensions
|
|||
{
|
||||
public static string GetExeDirectoryAbsolute()
|
||||
{
|
||||
var path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
||||
if (string.IsNullOrEmpty(path)) throw new Exception();
|
||||
if (path.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
||||
{
|
||||
path = path.Remove(path.Length - 1, 1);
|
||||
|
|
Loading…
Reference in New Issue