Prevent crashing when removing the last plugin in the list
This commit is contained in:
parent
59e303c882
commit
3e1a0ff5a3
1 changed files with 9 additions and 0 deletions
|
|
@ -350,6 +350,15 @@ void Ui::OpenRGBPluginsPage::on_PluginsList_itemSelectionChanged()
|
|||
\*-----------------------------------------------------*/
|
||||
int cur_row = ui->PluginsList->currentRow();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Disable the remove button if no item selected |
|
||||
\*-----------------------------------------------------*/
|
||||
if(cur_row == -1)
|
||||
{
|
||||
ui->RemovePluginButton->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Enable the remove button when there's a selected item |
|
||||
| and the selected item is not a system plugin |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue