Skip to content

Commit

Permalink
MythUISpinBox::keyPressEvent: prevent segfault
Browse files Browse the repository at this point in the history
Edit a recording schedule, then press '>' quickly, and mythfrontend will
segfault.
MythUIButtonList::GetItemCurrent() can return a nullptr so check for
it in MythUISpinBox::keyPressEvent()
  • Loading branch information
jpoet committed Dec 24, 2018
1 parent 72766c2 commit 1616cbb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mythtv/libs/libmythui/mythuispinbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ bool MythUISpinBox::keyPressEvent(QKeyEvent *event)
if (handled)
return true;

QString initialEntry = GetItemCurrent()->GetText();
MythUIButtonListItem *item = GetItemCurrent();
if (item == nullptr)
return MythUIButtonList::keyPressEvent(event);

QString initialEntry = item->GetText();
bool doEntry = false;

// Only invoke the entry dialog if the entry is a number
Expand Down

0 comments on commit 1616cbb

Please sign in to comment.