Skip to content

multiple times in listener.length can not exist when object does not exist either #1

@designerfuzzi

Description

@designerfuzzi

https://github.com/pjb493/MIDIWebView/blob/793edd9d37a89e58ecbe285fec00818d009d436a/MIDIWebViewPolyfill/src/MIDIEventDispatcher.js#L8

this particular line of code is multiple times in your lib and will certainly fail.
The encapsulated for loop and so on can not expose listener.length when there is no listener object ..
guess shall be easy fixed to

const listener = this._listener[index]
if (listener) {
    for (var i=0; i< listener.length; ++i) {
        //do something here
    }
}

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