[CFGUI-118] Definitions app filter yields NPE error banner with null/missing values Created: 11/Jun/20  Updated: 25/Mar/22

Status: Open
Project: Definitions App
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Mikaël Geljić Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File definitions-app-npe.png    
Issue Links:
Relates
relates to BLOSSOM-272 DialogCreatorDefinitionDecorator is w... Closed
relates to MGNLUI-5822 Data provider for select fields doesn... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

If the module registry contains a null entry (e.g. Blossom produced null module name in definition metadata, see PR for BLOSSOM-272 for remediation), then the corresponding column filter's data-provider might suffer from that, and produce an NPE when opening the app.

UI's CaptionFilteringDataProviderWrapper computes its size from plain Stream#count, and since the wrapped data-provider ModuleDefinitionSelectFieldSupport.ModuleDefinitionDataProvider#fetch returns a stream with distinct/sorted operations, Stream#count attempts (and fails) to compare distinct null entries, hence no count.

java.lang.NullPointerException: null
        at java.util.Comparators$NaturalOrderComparator.compare(Comparators.java:52) ~[?:1.8.0_144]
	...
        at java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:387) ~[?:1.8.0_144]
	at java.util.stream.DistinctOps$1$2.end(DistinctOps.java:168) ~[?:1.8.0_144]
        ...
	at java.util.stream.ReferencePipeline.count(ReferencePipeline.java:526) ~[?:1.8.0_144]
	at info.magnolia.ui.contentapp.CaptionFilteringDataProviderWrapper.size(CaptionFilteringDataProviderWrapper.java:95) ~[magnolia-ui-framework-6.2.1.jar:?]

Generated at Mon Feb 12 00:45:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.