mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 22:45:55 -04:00
Prevent crashing when removing the last plugin in the list
This commit is contained in:
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user