Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

TypeError: Cannot read property 'removeChild' of null #2038

Description

@lironbar

For anyone hitting this issue when clustering markers, it is a result of using third-party library of MarkerWithLabel

`MarkerLabel_.prototype.onRemove = function () {
var i;
this.labelDiv_.parentNode.removeChild(this.labelDiv_);
this.eventDiv_.parentNode.removeChild(this.eventDiv_);

// Remove event listeners:
for (i = 0; i < this.listeners_.length; i++) {
google.maps.event.removeListener(this.listeners_[i]);
}
};`

needs to change this:

this.labelDiv_.parentNode.removeChild(this.labelDiv_);

to this:

if (this.labelDiv_.parentNode){ this.labelDiv_.parentNode.removeChild(this.labelDiv_); }

@nmccready
any fix for that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions