Ticket #814 (closed Bug: fixed)
sourceElement can become NULL in function clickHandler
| Reported by: | mgc8 | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | Piwik 0.4.1 |
| Component: | Core | Keywords: | clickHandler, sourceElement, null |
| Cc: | Sensitive: |
Description
In the function clickHandler(clickEvent) at line 661 in piwik.js, the while loop executes
sourceElement = sourceElement.parentNode;
without checking sourceElement.parentNode. This can lead to sourceElement becoming NULL and errors in the following code.
A patch is simple enough:
--while ((tag = sourceElement.tagName) != 'A' && tag != 'AREA') {
++while ((sourceElement.parentNode) && ((tag = sourceElement.tagName) != 'A' && tag != 'AREA')) {
Thanks, Mihnea
Change History
Note: See
TracTickets for help on using
tickets.
