Bug 604 - Null pointer exception for non-member checkout
Summary: Null pointer exception for non-member checkout
Status: RESOLVED FIXED
Alias: None
Product: CS3343 2021/09 POS System
Classification: Unclassified
Component: function (show other bugs)
Version: 0.0.1
Hardware: PC Windows
: --- critical
Assignee: chakfpoon2-c
URL:
Depends on:
Blocks:
 
Reported: 2021-11-24 10:30 HKT by chakfpoon2-c
Modified: 2021-11-25 11:10 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chakfpoon2-c 2021-11-24 10:30:11 HKT
The problem will be triggered when a non-member customer does checkout procedure. It will return a null pointer exception in the console and the program will halt.

==================================================================================
Please input your Worker ID for logging in the system...
1
Please input your Member ID for logging in the system...
0
---Welcome to Morx Supermarket---
---To continue, please proceed your actions---
Input (1) for accessing Inventory System
Input (2) for accessing Checkout System
Input (3) for accessing Sales System
Input (4) for accessing Membership System
Input (5) for switching member
Input (6) to exit
2
---Welcome to Checkout System, ON9.---
Input commands for further management:
Input (1) for Checkout
Input (2) for refund
Input (3) for exit
1
No                  Description         Quantity            Price($)            
1                   Coke                200                 2000.0              
2                   Salt                50                  1000.0              
Please input (0) for proceed to checkout
Please input (1) for remove products
Please input (2) for modify quantities of products
Please input (3) to cancel the checkout process
0
The total amount is: $3000.00
Please Input the amount of dollars that the customers paid
3100
Total changes is $100.00
Comment 1 chakfpoon2-c 2021-11-25 11:10:43 HKT
The problem has been solved by the same method of bug603.
==================================================================================
	public void removeCartAfterTransaction(Member member) {
		member.getCart().clear();
	}
==================================================================================
Please input your Worker ID for logging in the system...
1
Please input your Member ID for logging in the system...
0
---Welcome to Morx Supermarket---
---To continue, please proceed your actions---
Input (1) for accessing Inventory System
Input (2) for accessing Checkout System
Input (3) for accessing Sales System
Input (4) for accessing Membership System
Input (5) for switching member
Input (6) to exit
2
---Welcome to Checkout System, ON9.---
Input commands for further management:
Input (1) for Checkout
Input (2) for refund
Input (3) for exit
1
No                  Description         Quantity            Price($)            
1                   Coke                200                 2000.0              
2                   Salt                50                  1000.0              
Please input (0) for proceed to checkout
Please input (1) for remove products
Please input (2) for modify quantities of products
Please input (3) to cancel the checkout process
0
The total amount is: $3000.00
Please Input the amount of dollars that the customers paid
3000
Total changes is $0.00
Input commands for further management:
Input (1) for Checkout
Input (2) for refund
Input (3) for exit