drop icon indicating copy to clipboard operation
drop copied to clipboard

Check for drop to prevent race conditions

Open anvaka opened this issue 7 years ago • 2 comments

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.

anvaka avatar Mar 15 '17 13:03 anvaka

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.

zmdavis avatar Mar 16 '17 16:03 zmdavis

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.

zmdavis avatar Mar 16 '17 17:03 zmdavis