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

Add a check to within to avoid panic on empty kdtree #12

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

amfaber
Copy link
Contributor

@amfaber amfaber commented Jan 7, 2023

Hi!
Love the crate, its powering parts of my microscopy particle detection algorithm. I just ran into a rare bug in which the kdtree I was querying against was empty, which resulted in a panic on line 18 in within.rs. I've just manually added a check to my code to ensure I never query against an empty kd-tree, but I thought you might have some interest in avoiding this edge-case as well.

Thanks for the great work :)

Copy link
Owner

@u1roh u1roh left a comment

Choose a reason for hiding this comment

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

Wow, thank you for the contribution!
And I'm happy that this library is useful for you.

@u1roh u1roh merged commit 3d6cbb2 into u1roh:main Jan 9, 2023
@u1roh u1roh added the bug Something isn't working label Jan 9, 2023
@u1roh
Copy link
Owner

u1roh commented Jan 9, 2023

Fixed a little: #13
Released v0.5.1: https://crates.io/crates/kd-tree/0.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants