Fix favicon onerror null parent
Capture parent before removing broken favicon image to avoid insertAdjacentHTML on null. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -279,7 +279,7 @@
|
||||
<div class="favicon" aria-hidden="true">
|
||||
${
|
||||
fav
|
||||
? `<img src="${escapeHtml(fav)}" alt="" loading="lazy" decoding="async" referrerpolicy="no-referrer" onerror="this.remove(); this.parentNode.insertAdjacentHTML('beforeend','<div class="letter">${letter}</div>');" />`
|
||||
? `<img src="${escapeHtml(fav)}" alt="" loading="lazy" decoding="async" referrerpolicy="no-referrer" onerror="const p=this.parentNode; this.remove(); if(p) p.insertAdjacentHTML('beforeend','<div class="letter">${letter}</div>');" />`
|
||||
: `<div class="letter">${letter}</div>`
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user