Skip to content

Commit

Permalink
Prevent CDL's "Disassemble..." when not implemented crashing EmuHawk
Browse files Browse the repository at this point in the history
(by disabling the button)
see #1274
  • Loading branch information
YoshiRulz committed Jan 15, 2025
1 parent 93f3381 commit 0d05c1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BizHawk.Client.EmuHawk/tools/CDL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public CDL()

public override void Restart()
{
DisassembleMenuItem.Tag = CodeDataLogger.GetType().GetMethod(nameof(ICodeDataLogger.DisassembleCDL))!
.IsImplemented();
//don't try to recover the current CDL!
//even though it seems like it might be nice, it might get mixed up between games. even if we use CheckCDL. Switching games with the same memory map will be bad.
_cdl = null;
Expand Down Expand Up @@ -283,8 +285,8 @@ private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
SaveAsMenuItem.Enabled =
AppendMenuItem.Enabled =
ClearMenuItem.Enabled =
DisassembleMenuItem.Enabled =
_cdl != null;
DisassembleMenuItem.Enabled = _cdl is not null && /*core implements feature*/(bool) DisassembleMenuItem.Tag;

miAutoSave.Checked = CDLAutoSave;
miAutoStart.Checked = CDLAutoStart;
Expand Down

0 comments on commit 0d05c1d

Please sign in to comment.