Prevent index access errors in entity quick bar (#9964)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Philip Allgaier 2021-09-06 11:01:18 +02:00 committed by GitHub
parent bc09febd2c
commit 2bd9b5a015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,6 +299,10 @@ export class QuickBar extends LitElement {
private _handleSelected(ev: SingleSelectedEvent) {
const index = ev.detail.index;
if (index < 0) {
return;
}
const item = ((ev.target as List).items[index] as any).item;
this.processItemAndCloseDialog(item, index);
}