drop
drop copied to clipboard
Check for drop to prevent race conditions
The inHandler
uses setTimeout()
function to schedule this.open()
call. If client calls drop.destroy()
before timeout is triggered, the instance of this.drop
will be set to null
which results in unhandled error in open()
This change fixes the unhandled error.
Thanks for doing this. I was about to open a similar pull request when I noticed this one.
Based on CONTRIBUTING.md you'll need to run npm run build
and gulp version:patch
and commit the output if we want this to get merged.
Also, I believe it's possible to run into a similar problem in the close
method, so you may want to add a similar fix there.
Also note that this problem has already been solved in two slightly different ways (#139 and #153) with no movement afaict on getting either of those PRs merged.