diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-02-08 15:24:59 +0100 |
---|---|---|
committer | Gökay ŞATIR <gokaysatir@gmail.com> | 2022-03-03 14:26:00 +0300 |
commit | 09f063bb0475c981d7758f6ac53b84e042aa1d1d (patch) | |
tree | 53a3de0ac7237c9630509bf9f9d3308bc12066af | |
parent | draw: added more details in the draw status bar (diff) | |
download | online-09f063bb0475c981d7758f6ac53b84e042aa1d1d.tar.gz online-09f063bb0475c981d7758f6ac53b84e042aa1d1d.zip |
Check if section.boundsList is defined before use
Change-Id: Id6c3d930110bd0b15b8825cea42fadb78d54807c
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | loleaflet/src/layer/tile/CanvasSectionContainer.ts | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/loleaflet/src/layer/tile/CanvasSectionContainer.ts b/loleaflet/src/layer/tile/CanvasSectionContainer.ts index fcd86b9b4f..1f0886465f 100644 --- a/loleaflet/src/layer/tile/CanvasSectionContainer.ts +++ b/loleaflet/src/layer/tile/CanvasSectionContainer.ts @@ -625,6 +625,9 @@ class CanvasSectionContainer { } private orderBoundsList(section: CanvasSectionObject) { + if (!section.boundsList) + return; + // According to zIndex & drawingOrder. for (var i: number = 0; i < section.boundsList.length - 1; i++) { for (var j = i + 1; j < section.boundsList.length; j++) { @@ -682,6 +685,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onClick((position ? [position[0], position[1]]: null), e); @@ -707,6 +713,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onDoubleClick((position ? [position[0], position[1]]: null), e); @@ -730,6 +739,9 @@ class CanvasSectionContainer { } } + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMouseLeave((position ? [position[0], position[1]]: null), e); @@ -744,6 +756,9 @@ class CanvasSectionContainer { // This event is handled in the mouseEnter event of the canvas itself (for window sections). + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMouseEnter((position ? [position[0], position[1]]: null), e); @@ -768,6 +783,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMouseMove((position ? [position[0], position[1]]: null), dragDistance, e); @@ -793,6 +811,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onLongPress((position ? [position[0], position[1]]: null), e); @@ -818,6 +839,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMouseDown((position ? [position[0], position[1]]: null), e); @@ -843,6 +867,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMouseUp((position ? [position[0], position[1]]: null), e); @@ -867,6 +894,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onContextMenu(); @@ -892,6 +922,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMouseWheel((position ? [position[0], position[1]]: null), delta, e); @@ -916,6 +949,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMultiTouchStart(e); @@ -941,6 +977,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMultiTouchMove((position ? [position[0], position[1]]: null), distance, e); @@ -965,6 +1004,9 @@ class CanvasSectionContainer { } if (propagate) { + if (!section.boundsList) + return; + for (var i: number = section.boundsList.length - 1; i > -1; i--) { if (section.boundsList[i].interactable) section.boundsList[i].onMultiTouchEnd(e); |