diff --git a/src/BizHawk.Bizware.DirectX/DirectInputAdapter.cs b/src/BizHawk.Bizware.DirectX/DirectInputAdapter.cs index 5cb93994dd..b166ef6d65 100644 --- a/src/BizHawk.Bizware.DirectX/DirectInputAdapter.cs +++ b/src/BizHawk.Bizware.DirectX/DirectInputAdapter.cs @@ -53,7 +53,7 @@ namespace BizHawk.Bizware.DirectX } } - public IEnumerable ProcessHostKeyboards() => KeyInput.Update(_config ?? throw new NullReferenceException("o noes")) + public IEnumerable ProcessHostKeyboards() => KeyInput.Update(_config ?? throw new Exception(nameof(ProcessHostKeyboards) + " called before the global config was passed")) .Concat(IPCKeyInput.Update()); public void UpdateConfig(Config config) => _config = config; diff --git a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs b/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs index e3be44274f..09f29a1b3a 100644 --- a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs +++ b/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs @@ -18,7 +18,9 @@ namespace BizHawk.Client.DiscoHawk public MainDiscoForm() { InitializeComponent(); - Icon = new Icon(typeof(MainDiscoForm).Assembly.GetManifestResourceStream("BizHawk.Client.DiscoHawk.discohawk.ico") ?? throw new NullReferenceException()); + var icoStream = typeof(MainDiscoForm).Assembly.GetManifestResourceStream("BizHawk.Client.DiscoHawk.discohawk.ico"); + if (icoStream != null) Icon = new Icon(icoStream); + else Console.WriteLine("couldn't load .ico EmbeddedResource?"); } private void MainDiscoForm_Load(object sender, EventArgs e) diff --git a/src/BizHawk.Common/TempFileManager.cs b/src/BizHawk.Common/TempFileManager.cs index 44ff48318f..54ea95ebe9 100644 --- a/src/BizHawk.Common/TempFileManager.cs +++ b/src/BizHawk.Common/TempFileManager.cs @@ -31,7 +31,7 @@ namespace BizHawk.Common public static string RenameTempFilenameForDelete(string path) { string filename = Path.GetFileName(path); - var dir = Path.GetDirectoryName(path) ?? throw new NullReferenceException(); + var dir = Path.GetDirectoryName(path) ?? throw new InvalidOperationException(); if (!filename.StartsWith("biz-")) { throw new InvalidOperationException();