Skip to content

_destroyBait needs to check for existence of bait before trying to remove it #29

@m90

Description

@m90

From looking at the errors in our Sentry setup I can see that there are cases where the bait has already been removed by someone before the library calls the _destroyBait method here:

window.document.body.removeChild(this._var.bait);

Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

Since the library theoretically emits the events after removing the bait, this will never happen in case the above throws.

Ideally the library would simply check if the bait is still in the DOM before trying to remove it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions