mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 05:20:45 +00:00
Add safety to satisfy Coverity on some errors that are likely impossible
* Reported by Coverity Scan
This commit is contained in:
@@ -170,7 +170,12 @@ void EnvironmentEditor::on_deleteButton_clicked()
|
||||
if(!sel)
|
||||
return;
|
||||
|
||||
delete ui->variables->takeTopLevelItem(ui->variables->indexOfTopLevelItem(sel));
|
||||
int idx = ui->variables->indexOfTopLevelItem(sel);
|
||||
|
||||
if(idx >= 0)
|
||||
delete ui->variables->takeTopLevelItem(idx);
|
||||
else
|
||||
qCritical() << "Can't find item to delete";
|
||||
|
||||
on_name_textChanged(ui->name->text());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user