Select to view content in your preferred language

Elevation Profile 3.35 destroy issue

535
0
03-15-2021 06:44 AM
PlatonYasev
New Contributor

Hey guys!

I've encountered a problem that Elevation Profile widget version 3.35 is being destroyed incorrectly. I've tested it in different situations (even in the sample for this widget), and in all cases during the process of destroying it throws this type error.

Uncaught TypeError: Cannot set property 'innerHTML' of null.    svg.js:formatted:278 
at Object.destroy (svg.js:formatted:278)
at Object.m ((index):201)
at Object.destroy (svg.js:formatted:1282)
at Object.destroy (Chart.js:5)
at Object.destroy (ProfileChart.js:31)
at Object.advice ((index):122)
at Object.e [as destroy] ((index):121)
at Object.destroy (ElevationProfile.js:22)
at Object.advice ((index):122)
at Object.e [as destroy] ((index):121)

 And here is the source code that throws an error directly (I've commented the desired line).

t.Surface = w("dojox.gfx.shape.Surface", null, {
                    constructor: function() {
                        this._parent = this.rawNode = null;
                        this._nodes = [];
                        this._events = []
                    },
                    destroy: function() {
                        p.forEach(this._nodes, n.destroy);
                        this._nodes = [];
                        p.forEach(this._events, function(b) {
                            b && b.remove()
                        });
                        this._events = [];
                        this.rawNode = null;
                        if (u("ie"))
                            for (; this._parent.lastChild; )
                                n.destroy(this._parent.lastChild);
                        else
                            this._parent.innerHTML = ""; // it crashes here
                        this._parent = null
                    },
                    getEventSource: function() {
                        return this.rawNode
                    },
                    _getRealMatrix: function() {
                        return null
                    },
                    isLoaded: !0,
                    onLoad: function(b) {},
                    whenLoaded: function(b, k) {
                        var l = x.hitch(b, k);
                        if (this.isLoaded)
                            l(this);
                        else
                            f.once(this, "load", function(e) {
                                l(e)
                            })
                    }
                });

 Has anyone else encountered the problem? 

0 Kudos
0 Replies