Media prefs: fix crash in empty MIDI soundfont list

Check if soundfont list is empty or we crash when double-clicking
into the list.

Fixes #13091.
This commit is contained in:
Humdinger 2016-11-25 07:26:09 +01:00
parent d676701752
commit dd3732bb93
1 changed files with 3 additions and 0 deletions

View File

@ -136,6 +136,9 @@ MidiSettingsView::MessageReceived(BMessage* message)
case kDoubleClick:
{
int selection = fListView->CurrentSelection();
if (selection < 0)
break;
BStringItem* item = (BStringItem*)fListView->ItemAt(selection);
BEntry entry(item->Text());