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

Handle null condition for locale in OrganizationTypeConfigurationModelListener.java

    Details

    • Type: Bug
    • Status: Verified
    • Resolution: Unresolved
    • Affects Version/s: 7.2.X, Master
    • Fix Version/s: None
    • Component/s: Portal Configuration
    • Labels:

      Description

      Calling to

      ResourceBundleUtil.getBundle("content.Language", LocaleThreadLocal.getThemeDisplayLocale(), getClass());


      causes a NPE when

      LocaleThreadLocal.getThemeDisplayLocale()

      is null:

      Caused by: java.lang.NullPointerException
              at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1618)
              at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1593)
              at java.base/java.util.ResourceBundle.getBundle(ResourceBundle.java:1509)
              at com.liferay.portal.kernel.util.ResourceBundleUtil._getBundle(ResourceBundleUtil.java:242)
              at com.liferay.portal.kernel.util.ResourceBundleUtil.getBundle(ResourceBundleUtil.java:96)
              at com.liferay.portal.kernel.util.ResourceBundleUtil.getBundle(ResourceBundleUtil.java:88)
              at com.liferay.organizations.internal.configuration.persistence.listener.OrganizationTypeConfigurationModelListener._getResourceBundle(OrganizationTypeConfigurationModelListener.java:62)
              at com.liferay.organizations.internal.configuration.persistence.listener.OrganizationTypeConfigurationModelListener._validateUniqueConfiguration(OrganizationTypeConfigurationModelListener.java:100)
              at com.liferay.organizations.internal.configuration.persistence.listener.OrganizationTypeConfigurationModelListener.onBeforeSave(OrganizationTypeConfigurationModelListener.java:52)
              ... 69 more
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              sergio.alonso Sergio Alonso
              Participants of an Issue:
              Recent user:
              Liferay JIRA Bot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Days since last comment:
                35 weeks, 4 days ago

                  Packages

                  Version Package