Bug 1613308 - Catch errors drawing the favicon when dragging from the identity block. r=ewright

Differential Revision: https://phabricator.services.mozilla.com/D63318

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Johann Hofmann 2020-02-20 21:16:27 +00:00
Родитель c90fa01f07
Коммит 57e87258be
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -1299,7 +1299,13 @@ var gIdentityHandler = {
let tabIcon = gBrowser.selectedTab.iconImage;
let image = new Image();
image.src = tabIcon.src;
ctx.drawImage(image, 0, 0, 16 * scale, 16 * scale);
try {
ctx.drawImage(image, 0, 0, 16 * scale, 16 * scale);
} catch (e) {
// Sites might specify invalid data URIs favicons that
// will result in errors when trying to draw, we can
// just ignore this case and not paint any favicon.
}
let dt = event.dataTransfer;
dt.setData("text/x-moz-url", urlString);