Bugfix #6025 introduces exception in GridLayer._tileReady - a parameter check is missing
See original GitHub issueLeaflet 1.3.2/1.3.3 has a fix that does not check a parameter for null/undefined and crashes in my scenario because GridLayer._tileReady(coords, err, tile) gets called with tile = null.
By fix #6025 GridLayer.js line 845 is changed to:
if (!this._map || tile.getAttribute('src') === Util.emptyImageUrl) { return; }
but tile is not checked.
I propose fixing this by
if (!this._map || (tile && tile.getAttribute('src') === Util.emptyImageUrl)) { return; }
I fear I can’t give a fiddle because I have a complicated scenario involving a subclassed leaflet.vectorgrid. The code worked fine with Leaflet 1.3.1 that didn’t have the second condition in the if statement.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:5
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I concur with this, same situation, running Leaflet 1.3.3 with Leaflet.VectorGrid.
Works fine in 1.3.1 and 1.2.0
Any idea if there will be a release soon incorporating this fix?