mirror of
https://github.com/fadden/6502bench.git
synced 2025-02-21 12:29:00 +00:00
Fix Actions menu crash
If you open the Actions menu when nothing is selected, the "can I create a local variable table here" method crashes with a bad index reference. Issue #48.
This commit is contained in:
parent
14150af004
commit
e2b5b12e13
@ -1650,8 +1650,11 @@ namespace SourceGen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool CanCreateLocalVariableTable() {
|
public bool CanCreateLocalVariableTable() {
|
||||||
int selIndex = mMainWin.CodeListView_GetFirstSelectedIndex();
|
if (SelectionAnalysis.mNumItemsSelected != 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Only allow on code lines. This is somewhat arbitrary; data would work fine.
|
// Only allow on code lines. This is somewhat arbitrary; data would work fine.
|
||||||
|
int selIndex = mMainWin.CodeListView_GetFirstSelectedIndex();
|
||||||
if (CodeLineList[selIndex].LineType != LineListGen.Line.Type.Code) {
|
if (CodeLineList[selIndex].LineType != LineListGen.Line.Type.Code) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user