New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
guard against null _disabledEventEmissions in Observer#fireEvent #1970
Conversation
hmmm... this doesn't seem to be fixing the crash |
nevermind. I'm doing something dumb. |
@katspaugh I was doing something dumb in my own code and in this fix. But it does need to be fixed, regions are totally broken in master. |
The problem is with https://github.com/katspaugh/wavesurfer.js/blob/master/src/util/observer.js#L124 Inside It looks like Observer is somehow broken, not Regions plugin. |
@cadavre test it yourself before and after this patch. this does indeed fix it... |
@katspaugh updated with single quotes |
Agreed. All of the plugins that use observer are broken currently, e.g. microphone plugin. I don't like adding this change to every plugin (unless there's really no other way). |
well @thijstriemstra here's the other approach... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks better. Can you add a changelog entry and update PR title?
the regions plugin notably was using all the functions of Observer without calling the constructor, triggering a crash
880f11d
to
c5ac3f0
Compare
@thijstriemstra updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…spaugh#1970) the regions plugin notably was using all the functions of Observer without calling the constructor, triggering a crash
due to the odd way the RegionsPlugin pulls in the methods in util.Observer, it needs to setup a private array or it crashes in
fireEvent
.I could also fix this in
Observer
by checking for the existence of the array. I dunno. both seem odd.fixes #1975