Uploaded image for project: 'PUBLIC - Liferay Commerce'
  1. PUBLIC - Liferay Commerce
  2. COMMERCE-4418

Create a product bundle without SKUs throws a NPE

    Details

    • Severity of Issue:
      Major
    • Application Servers:
      Apache Tomcat 9.0.x
    • Browsers:
      Chrome (latest)
    • Device Type:
      Desktop
    • Search:
      Elasticsearch 6.x

      Description

      Assumptions

      • An already created Minium site.

      Steps to Reproduce

      • Go to Control Panel → Commerce → Options.
      • Create a new option with all toggles active (Option Test) and with two values OV1, OV2.
      • Go to Control Panel → Commerce → Products.
      • Create two products with SKUs (P1 → SKU1, P2 → SKU2).
      • Create another product (P3) and add one option (Option Test).
      • Edit the option.
      • Set "Field Type" to "Select From The List" and "Set Price Type" to "Static" and link the values to the SKUs with a price (OV1 → SKU1, OV2 →  SKU2).
      • Go into the SKUs tab.
      • Delete all the SKUs.
      • Go to Minium site.

      Expected Result

       You can see the P3 card.

      Actual Result

       You can't see the P3 card and you receive an NPE in the log.

      ERROR [http-nio-8080-exec-8][IncludeTag:128] Current URL /group/minium generates exception: java.lang.NullPointerExceptionERROR [http-nio-8080-exec-8][IncludeTag:128] Current URL /group/minium generates exception: java.lang.NullPointerExceptionjava.lang.NullPointerException at com.liferay.commerce.internal.price.BaseCommerceProductPriceCalculation.getCPDefinitionMinimumPrice(BaseCommerceProductPriceCalculation.java:66) at com.liferay.commerce.frontend.internal.util.ProductHelperImpl.getMinPrice(ProductHelperImpl.java:63) at com.liferay.commerce.theme.minium.internal.product.renderer.list.entry.MiniumCPContentListEntryRenderer.render(MiniumCPContentListEntryRenderer.java:268) at org.apache.jsp.product_005flist_005fentry_005frenderer.page_jsp._jspService(page_jsp.java:121) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:373) at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:385) at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153) at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62) at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120) at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48) at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67) at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:201) at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79) at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lorenzo.lapescara Lorenzo La Pescara
              Reporter:
              pietro.bocale Pietro Bocale
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  7.4 CE GA1