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

Fix NPE when clear is called after destroy #287

Merged
merged 2 commits into from
Aug 28, 2019
Merged

Fix NPE when clear is called after destroy #287

merged 2 commits into from
Aug 28, 2019

Conversation

sdwvit
Copy link
Contributor

@sdwvit sdwvit commented Aug 28, 2019

Fixes: https://github.com/busbud/public-website/issues/8331

Summary

It is possible to have Null Pointer Exception, when 'clear' is called immediately after 'destroy' (due to async code somewhere in jquery and user spamming some controls).
Adding a simple check prevents this error.

Original error:
Screen Shot 2019-08-27 at 12 49 39 PM

Some debugging:
Screen Shot 2019-08-27 at 12 54 26 PM
Screen Shot 2019-08-27 at 1 00 03 PM

Screen Shot 2019-08-27 at 12 54 34 PM

Result

No more NPE

@coveralls
Copy link

coveralls commented Aug 28, 2019

Coverage Status

Coverage increased (+0.01%) to 88.959% when pulling c5c2223 on sdwvit:master into 93c21b7 on algolia:master.

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. This new test breaks on master right?

@sdwvit
Copy link
Contributor Author

sdwvit commented Aug 28, 2019

@Haroenv correct
Screen Shot 2019-08-28 at 11 56 23 AM

@Haroenv Haroenv merged commit 244425d into algolia:master Aug 28, 2019
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 this pull request may close these issues.

3 participants