Skip to content

Commit 3e1a0ff

Browse files
committed
Prevent crashing when removing the last plugin in the list
1 parent 59e303c commit 3e1a0ff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

qt/OpenRGBPluginsPage/OpenRGBPluginsPage.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,15 @@ void Ui::OpenRGBPluginsPage::on_PluginsList_itemSelectionChanged()
350350
\*-----------------------------------------------------*/
351351
int cur_row = ui->PluginsList->currentRow();
352352

353+
/*-----------------------------------------------------*\
354+
| Disable the remove button if no item selected |
355+
\*-----------------------------------------------------*/
356+
if(cur_row == -1)
357+
{
358+
ui->RemovePluginButton->setEnabled(false);
359+
return;
360+
}
361+
353362
/*-----------------------------------------------------*\
354363
| Enable the remove button when there's a selected item |
355364
| and the selected item is not a system plugin |

0 commit comments

Comments
 (0)