Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-14712

Fix NPE in select2 widgets when parentId is not found

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.8.0-HF16, 5.9.4
    • Fix Version/s: 5.8.0-HF17, 5.9.5
    • Component/s: Layouts & Widgets
    • Upgrade notes:
      Hide

      Select2-based widgets do not throw NPE anymore when a vocabulary entry has a non-existing parent. The entry is displayed like any other orphan entry.

      Show
      Select2-based widgets do not throw NPE anymore when a vocabulary entry has a non-existing parent. The entry is displayed like any other orphan entry.

      Description

      Some usecases have been reported where vocabulary entries have a parentId which does not exist in the same vocabulary.

      It ends up with the following stacktrace:

      Caused by: java.lang.NullPointerException
      	at org.nuxeo.ecm.platform.ui.select2.automation.SuggestDirectoryEntries$JSONAdapter.<init>(SuggestDirectoryEntries.java:108)
      	at org.nuxeo.ecm.platform.ui.select2.automation.SuggestDirectoryEntries$JSONAdapter.push(SuggestDirectoryEntries.java:307)
      	at org.nuxeo.ecm.platform.ui.select2.automation.SuggestDirectoryEntries.run(SuggestDirectoryEntries.java:525)
      

      This kind of vocabulary is not consistent but we can avoid an NPE on this case and allow to display such vocabulary entry as an orphan entry (like if the parentId was null).

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                PagerDuty

                Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.