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 NullPointerException triggered by calling imgLabeling.getType() #73

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

maarzt
Copy link
Contributor

@maarzt maarzt commented Aug 29, 2024

The bug was discovered by compiling and testing Labkit against imglib2-7.1. Trying to use the brush in Labkit would trigger this NullPointerException.

I'm unsure about the rules for implementing the new getType() so please have a closer look at my suggested change and whether is correct.

I also noticed that (A) imgLabeling.getType().createVariable() would behave differently than (B) imgLabeling.randomAccess().get().createVariable(). (A) creates a LabelingType with a independent LabelMapping while (B) creates a LabelingType with the same LabelMapping as the imgLabeling. In Labkit I'm now using implementation (B) because a need the same LabelMapping in order for LabelingType.set(...) to work properly.

…lear()

The bug was discovered by compiling and testing Labkit against
imglib2-7.1. Trying to use the brush in Labkit would trigger this
NullPointerException.
@tpietzsch tpietzsch merged commit 4cf94b5 into master Sep 2, 2024
1 check passed
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.

2 participants