Do something cleverer than throwing NRE in a few places
This commit is contained in:
parent
e976e0c2ad
commit
979afcb54d
|
@ -53,7 +53,7 @@ namespace BizHawk.Bizware.DirectX
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerable<KeyEvent> ProcessHostKeyboards() => KeyInput.Update(_config ?? throw new NullReferenceException("o noes"))
|
||||
public IEnumerable<KeyEvent> 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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue