Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

mdMenu: invalid comparison in menu-iterim-element.js #3252

@Frank3K

Description

@Frank3K

In menu-interim-element.js there is an invalid comparison in the onclick-handler of the menuContentEl. Line #157 (058efeb) contains the following check:

 do {
    if (target && target.hasAttribute('ng-click')) {
      ...
    }
  } while ((target = target.parentNode) && target != opts.menuContentEl)

target is here a native DOM element, whereas opts.menuContentEl is a jqLite object. Therefore the comparison is always true. This can lead to an error since target can now become (in given conditions) equal to document, which does not have a hasAttribute method.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions