[ECOMMERCE-508] Error when select product Created: 21/Mar/22  Updated: 18/Oct/22  Resolved: 25/Mar/22

Status: Closed
Project: E-commerce
Component/s: None
Affects Version/s: 1.3.1
Fix Version/s: 1.3.2

Type: Bug Priority: Neutral
Reporter: Lam Nguyen Bao Assignee: Lam Nguyen Bao
Resolution: Done Votes: 0
Labels: VN-Analysis, VN-Maintenance, VN-Testing
Remaining Estimate: Not Specified
Time Spent: 7h
Original Estimate: Not Specified

Attachments: PNG File image-2022-03-21-15-31-10-809.png     PNG File image-2022-03-21-15-32-16-044.png     PNG File image-2022-03-21-16-02-24-535.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Epic Link: AuthorX Maintenance
Sprint: AuthorX 6
Story Points: 2

 Description   

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.


Generated at Mon Feb 12 01:44:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.