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

NPE when trying to render multi-valued widgets (List, Select, MultiSelect) with empty candidates expression #2072

Closed
pcdavid opened this issue Jun 15, 2023 · 0 comments · Fixed by #2073

Comments

@pcdavid
Copy link
Member

pcdavid commented Jun 15, 2023

Newly created List/Select/MultiSelect widgets (in a View-based form) have empty expressions for theirs values/candidates.
This should mean "no candidate", but because of how ViewFormDescriptionConverterSwitch.getMultiValueProvider(String) is implemented this results in a non-null and non-empty list of candidates/items, with a single "" (empty string) item.
This causes NPEs later when when e.g. trying to determine the id/label/kind of "".

Basically, an empty expression should mean "no candidates" (List.of()), and not as is the case now "a single candidate that is the empty string" (List.of("")).

It's quite annoying because it means these widgets are not "ready to use" (even in an empty but valid state) on creation, and one always has to provide explicit configuration for them.

@pcdavid pcdavid added this to the 2023.8.0 milestone Jun 15, 2023
pcdavid added a commit that referenced this issue Jun 15, 2023
Bug: #2072
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@pcdavid pcdavid self-assigned this Jun 15, 2023
pcdavid added a commit that referenced this issue Jun 15, 2023
…ession

Bug: #2072
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
pcdavid added a commit that referenced this issue Jun 20, 2023
…ession

Bug: #2072
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
pcdavid added a commit that referenced this issue Jun 20, 2023
…expression

Bug: #2072
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
pcdavid added a commit that referenced this issue Jun 20, 2023
…ession

Bug: #2072
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
AxelRICHARD pushed a commit that referenced this issue Jun 20, 2023
…ession

Bug: #2072
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment