Skip to content

Commit

Permalink
- fixed VM abort when entering search menu
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Sep 8, 2019
1 parent 06ad607 commit 526a576
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions wadsrc/static/zscript/ui/menu/optionmenu.zs
Expand Up @@ -107,15 +107,19 @@ class OptionMenu : Menu
mDesc = desc;
DontDim = desc.mDontDim;

let last = mDesc.mItems[mDesc.mItems.size() - 1];
bool lastIsText = (last is "OptionMenuItemStaticText");
if (lastIsText)
let itemCount = mDesc.mItems.size();
if (itemCount > 0)
{
String text = last.mLabel;
bool lastIsSpace = (text == "" || text == " ");
if (lastIsSpace)
let last = mDesc.mItems[itemCount - 1];
bool lastIsText = (last is "OptionMenuItemStaticText");
if (lastIsText)
{
mDesc.mItems.Pop();
String text = last.mLabel;
bool lastIsSpace = (text == "" || text == " ");
if (lastIsSpace)
{
mDesc.mItems.Pop();
}
}
}

Expand Down

0 comments on commit 526a576

Please sign in to comment.