[MGNLUI-6968] NullPointerException when opening app dialog of content that contains UUID link to not existing content Created: 03/Dec/21  Updated: 03/Dec/21  Resolved: 03/Dec/21

Status: Closed
Project: Magnolia UI
Component/s: dialogs
Affects Version/s: 6.2.11
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: wolf bubenik Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux, firefox


Issue Links:
duplicate
duplicates MGNLUI-6482 Dialog crashes if linkfield has unsup... 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
Date of First Response:

 Description   

Steps to reproduce

  1. have content app 1 with content that links to an other content app 2 (using twinColSelectField)
  2. in app 1 link some contents of app 2 and save
  3. delete one of the linked contents in app 2
  4. open content in app1 again

.. Logs, screenshots, gifs...

Expected results

  • content should be editable - editor can fix invalid link
  • may be show invalid UUID and allow deleting outdatad link

Actual results

  • content cannot be edited, NullPointerException in logs

 

Workaround

We helped our self by patching com.vaadin.ui.AbstractMultiSelect:

@Override
public void setValue(Set<T> value) {
    Objects.requireNonNull(value);
    // DZ-2133: Fix NullPointerException when trying to edit content with invalid multi value reference (uuid of removed content)
    Set<T> copy = value.stream().filter(Objects::nonNull).collect(Collectors.toCollection(LinkedHashSet::new));

    updateSelection(copy, new LinkedHashSet<>(getSelectedItems()));
} 

There is probably a better place for you to fix it.

Development notes



 Comments   
Comment by Mercedes Iruela [ 03/Dec/21 ]

Hello wolf,

this ticket seems to be duplicated by MGNLUI-6482.

Regards,

Mercedes

Generated at Mon Feb 12 09:41:49 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.