Skip to content
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

Error in PubSubClass after resizing #51

Closed
willtcarey opened this issue Mar 17, 2014 · 7 comments · Fixed by #54
Closed

Error in PubSubClass after resizing #51

willtcarey opened this issue Mar 17, 2014 · 7 comments · Fixed by #54

Comments

@willtcarey
Copy link

Unable to get property '0' of undefined or null reference Stack: jSignature.js Line Number:72

After we do a window resize we occasionally get this error. This is hard to reproduce for us, but happening fairly regularly at one of our customers sites.

If you need any more information, let me know

@brinley
Copy link
Owner

brinley commented Mar 20, 2014

Are you able to trigger this error on resize even if no signature is drawn?

@willtcarey
Copy link
Author

Yes we are. I managed to get it narrowed down. We have jSignature being used inside of a popup, and the first time that popup opens the user can do all the resizing they want, but they can also close that popup and reopen it a second time, and that second time they open it, it triggers the error if they do any resizing. We are calling reset on jSignature before they close the popup, but is there some sort of state data that is not being cleared?

@brinley
Copy link
Owner

brinley commented Mar 21, 2014

I suspect that the subscribed event for the first instance was still getting triggered and I suppose you are initializing a new jSignature instance? To confirm, can you run $("#signature").jSignature("globalEvents") before you close the modal and run $("#signature").jSignature("globalEvents") again after you reopen the modal as see if there is any difference.

@mgedmin
Copy link
Contributor

mgedmin commented Mar 23, 2014

This is the issue I tried to fix with willowsystems#44.

I'm confused about what the right upstream repo for this library is. The 1st google hit for "jsignature" points to http://willowsystems.github.io/jSignature/#/about/ which points to https://github.com/willowsystems/jSignature which says it's a fork of this one, but differs in exactly zero commits. Issues and pull requests made against willowsystems get no response.

@brinley
Copy link
Owner

brinley commented Mar 23, 2014

Willowsystem's version is a fork of my jSignature. I am not affiliated with them so I do not monitor their repo. I assume they are the first google hit because they have better SEO. If your fix works, send me a PR and I'll have a look and merge to my repo if it looks good.

@mgedmin
Copy link
Contributor

mgedmin commented Mar 24, 2014

I rebased my fix on top of your master, and I see that you already fixed the TypeError in PubSubClass.unsubscribe(), in a slightly different way.

I haven't had the time to fix the TypeError in PubSubClass.publish() yet. I'll submit a PR when I do.

mgedmin added a commit to mgedmin/jSignature that referenced this issue Apr 18, 2014
The problem was a callback registered with PubSubClass that wanted to
change the callback list, while PubSubClass was busy iterating over it.

Fixes brinley#51
@sondlerd
Copy link

sondlerd commented Sep 5, 2017

did this error get fixed? I'm getting this error now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants