mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
lightbox_canvas: Return from sizeCanvas() if parentNode is null.
The value of `canvas.parentNode` in `sizeCanvas()` appears to be `null` sometimes and it throwed an exception specially when you switch images from the images-list quickly.
This commit is contained in:
committed by
Tim Abbott
parent
8686bbf637
commit
2a80f4109a
@@ -229,6 +229,10 @@ const funcs = {
|
|||||||
// means that the height is less than 100% of the parent height. If so,
|
// means that the height is less than 100% of the parent height. If so,
|
||||||
// then we size the photo as w = 100%, h = 100% / 1.5.
|
// then we size the photo as w = 100%, h = 100% / 1.5.
|
||||||
sizeCanvas: function (canvas, meta) {
|
sizeCanvas: function (canvas, meta) {
|
||||||
|
if (canvas.parentNode === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof meta.onresize === "function") {
|
if (typeof meta.onresize === "function") {
|
||||||
meta.onresize(canvas);
|
meta.onresize(canvas);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user