scijava-common icon indicating copy to clipboard operation
scijava-common copied to clipboard

Boolean parameters "required but unset" if set to false

Open imagejan opened this issue 6 years ago • 0 comments

When using a (script) parameter that was not persisted (yet), like:

#@ Boolean somethingNeverPersisted
println somethingNeverPersisted

or

#@ Boolean (persist=false) somethingNeverPersisted
println somethingNeverPersisted

... and leaving the checkbox unchecked, you get the error message:

'somethingNeverPersisted' is required but unset

... making it impossible to input false.


The workaround is to always provide a default value:

#@ Boolean (value=false) somethingNeverPersisted
println somethingNeverPersisted

imagejan avatar Mar 23 '19 21:03 imagejan