[Libreoffice-commits] online.git: loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 15 15:14:22 UTC 2018


 loleaflet/src/layer/tile/GridLayer.js |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 579945002437f90d38d53da7fc0e32acafd9061e
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Nov 15 11:43:11 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Nov 15 16:14:03 2018 +0100

    Avoid TypeError: undefined is not an object
    
    (evaluating 'tile.src = this._tileCache[key]')
    
    Don't use the tile variable unless it has been assigned a value in the
    same loop iteration. (Also avoids the potential chance of using a
    leftover value from a previous loop iteration.)
    
    Change-Id: Iac445e968ca1bbd86a8c36730e74580622ae43d9
    Reviewed-on: https://gerrit.libreoffice.org/63429
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>

diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js
index 679f5caa3..d19e2d440 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -921,12 +921,13 @@ L.GridLayer = L.Layer.extend({
 						tile: tile,
 						coords: coords
 					});
+
+					if (this._tileCache[key]) {
+						tile.src = this._tileCache[key];
+					}
 				}
 			}
 
-			if (this._tileCache[key]) {
-				tile.src = this._tileCache[key];
-			}
 		}
 
 		// sort the tiles by the rows


More information about the Libreoffice-commits mailing list