mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add safety to satisfy Coverity on some errors that are likely impossible
* Reported by Coverity Scan
This commit is contained in:
@@ -640,8 +640,10 @@ void RemoteManager::on_deleteHost_clicked()
|
||||
|
||||
RemoteHost *host = getRemoteHost(item);
|
||||
|
||||
int itemIdx = ui->hosts->indexOfTopLevelItem(item);
|
||||
|
||||
// don't delete running instances on a host
|
||||
if(item->parent() != ui->hosts->invisibleRootItem() || !host)
|
||||
if(item->parent() != ui->hosts->invisibleRootItem() || itemIdx < 0 || !host)
|
||||
return;
|
||||
|
||||
QString hostname = item->text(0);
|
||||
@@ -664,7 +666,7 @@ void RemoteManager::on_deleteHost_clicked()
|
||||
|
||||
item->clear();
|
||||
|
||||
queueDelete(ui->hosts->takeTopLevelItem(ui->hosts->indexOfTopLevelItem(item)));
|
||||
queueDelete(ui->hosts->takeTopLevelItem(itemIdx));
|
||||
|
||||
ui->hosts->clearSelection();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user