Skip to content

Commit b9b7025

Browse files
committed
Bugfix: Failed to execute 'removeChild'
1 parent f38a8ea commit b9b7025

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎dist/leaflet.utfgrid-src.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ L.UtfGrid = (L.Layer || L.Class).extend({
262262
window[wk][functionName] = function (data) {
263263
self._cache[key] = data;
264264
delete window[wk][functionName];
265-
head.removeChild(script);
265+
if (script.parentElement===head) {
266+
head.removeChild(script);
267+
}
266268
self._finish_request(key);
267269
};
268270

‎dist/leaflet.utfgrid.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/leaflet.utfgrid.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ L.UtfGrid = (L.Layer || L.Class).extend({
253253
window[wk][functionName] = function (data) {
254254
self._cache[key] = data;
255255
delete window[wk][functionName];
256-
head.removeChild(script);
256+
if (script.parentElement===head) {
257+
head.removeChild(script);
258+
}
257259
self._finish_request(key);
258260
};
259261

0 commit comments

Comments
 (0)