Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-109450

NPE when not passing in the optional data field to <react:component /> taglib

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 7.2.10.1 DXP SP1
    • Fix Version/s: None
    • Component/s: ~[Archived] UI Taglibs
    • Labels:
      None

      Description

      When using the <react:component /> taglib, the tld indicates that the data field is not a required field.

      See: https://github.com/liferay/liferay-portal/blob/7.2.x/modules/apps/frontend-taglib/frontend-taglib-react/src/main/resources/META-INF/resources/react.tld#L25

      However on a jsp, when the data field is not supplied to the taglib, will observe a NPE on the _prepareData method on ReactRendererUtil at https://github.com/liferay/liferay-portal/blob/7.2.x/modules/apps/portal-template/portal-template-react-renderer-impl/src/main/java/com/liferay/portal/template/react/renderer/internal/ReactRendererUtil.java#L55.

      The _prepareData method is expecting a data param but doesn't seem to initialize data as an empty map if not supplied, as it is not a required field.

      Alternatively, initializing an empty map and supplying it to the taglib on a jsp resolves the NPE. If data is not a required field, perhaps it doesn't need to be serialized.

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            rebecca.dai Rebecca Dai
            Participants of an Issue:
            Recent user:
            Rebecca Dai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              51 weeks, 5 days ago

                Packages

                Version Package