Bug 452

Summary: NullPointerException thrown when executing output
Product: Group 25 Reporter: yingtng4-c
Component: BugAssignee: yingtng4-c
Status: RESOLVED WORKSFORME    
Severity: enhancement CC: rmohan2-c, tingkpoon2-c
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Windows   

Description yingtng4-c 2020-11-24 21:17:12 HKT

    
Comment 1 Poon Ting Kwok 2020-11-26 10:57:54 HKT
*** Bug 473 has been marked as a duplicate of this bug. ***
Comment 2 Baldur10 2020-11-26 23:54:03 HKT
Possible Solution by modifying Chef Class
Original
	public void cook(int time)
	{
		if(remainingTime == 0 && isAvailable == true)
		{
			Output.output(this.order, time);
			isAvailable = true;
			this.processedCustomerOrder.add(this.order.getCustomer().getTokenNumber());
			return;
		}
		else
		{
			remainingTime -= 1;
		}
	}

Changed to:

	public void cook(int time)
	{
		if(remainingTime == 0 && isAvailable == false)
		{
			Output.output(this.order, time);
			isAvailable = true;
			this.processedCustomerOrder.add(this.order.getCustomer().getTokenNumber());
			return;
		}
		else
		{
			remainingTime -= 1;
		}
	}