Skip to content

No Null Guard in _removeContainer #660

Description

@thkruz

Double clicking a toast message results in an error due to container being null and trying to fire .remove().

static _removeContainer() {
document.removeEventListener('mousemove', Toast._onDragMove);
document.removeEventListener('mouseup', Toast._onDragEnd);
Toast._container.remove();
Toast._container = null;
}

Adding a simple null guard would resolve this issue. Happy to do the PR if I can get a confirmation that it isn't something unique I am doing. I suspect that these kind of errors go unnoticed for a lot of people but is triggering my telemetry that watches for any errors globaly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions