Fixing tests where n might potentially be NULL#1967
Fixing tests where n might potentially be NULL#1967petebankhead merged 2 commits intoqupath:mainfrom
Conversation
|
Would table.sceneProperty().flatMap(Scene::windowProperty).flatMap(Window::showingProperty).orElse(Boolean.FALSE).addListener((v, o, n) -> {
if (n) updateShowTableColumnHeader();
});I didn't actually know of the |
|
I will not even pretend to be able to advise you one way or the other. But I can confirm your fix also works. The two tests would then be: and (in |
|
Ah good, could you update the PR for that please? I couldn't see a way to trigger the issue in QuPath without your script, so I think under 'normal' circumstances the null check might not be needed. I think the |
I'm really sorry about all the fuss. Of course it would be one of my scripts that causes such a niche issue ;-)
Done! |
|
Thanks! |
Hello,
This is to solve a very unlikely edge case where the variable
n(the new value of an observed property when it changes) is NULL in two tests (as far as I can tell) in the Brightness & Contrast dialog. This can happen because the dialog can be opened even if no image is available in the current viewer.Apparently a classic autounboxing null problem (?) in Java: When
nis null, this causes a NullPointerException because Java tries to invoken.booleanValue()on a null reference.I only noticed this because my autodock script crashed with
Cheers,
Egor