Uploaded image for project: 'E-commerce'
  1. E-commerce
  2. ECOMMERCE-508

Error when select product

XMLWordPrintable

      Step to reproduce:

      + Go to Pages app, add a product detail component on page.

      + Choose a product which the price is null as below image:

       

      Problem: 


      Development Notes:
      Stream/optional APIs are not well handling for retrieve product information. Potential NPE or 

      NoSuchElementException (call optional.get() without check, or accessing properties without null check) can be thrown.

      see CommercetoolsProduct#populatePrice -> call get() without check
      CommercetoolsProduct#populateImageURLs -> productProjection.getMasterVariant().getImages()

      We need to check and do some refactor to ensure that the APIs are using correctly.

        Acceptance criteria

          1. image-2022-03-21-15-31-10-809.png
            218 kB
            Lam Nguyen Bao
          2. image-2022-03-21-15-32-16-044.png
            218 kB
            Lam Nguyen Bao
          3. image-2022-03-21-16-02-24-535.png
            363 kB
            Thuy To

              lam.nguyen Lam Nguyen Bao
              lam.nguyen Lam Nguyen Bao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 7h
                    7h