Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-6968

NullPointerException when opening app dialog of content that contains UUID link to not existing content

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Medium Medium
    • None
    • 6.2.11
    • dialogs
    • None
    • linux, firefox

      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

        Acceptance criteria

              Unassigned Unassigned
              wolf.bubenik wolf bubenik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD