Bug 452 - NullPointerException thrown when executing output
Summary: NullPointerException thrown when executing output
Status: RESOLVED WORKSFORME
Alias: None
Product: Group 25
Classification: Unclassified
Component: Bug (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- enhancement
Assignee: yingtng4-c
URL:
: 473 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-24 21:17 HKT by yingtng4-c
Modified: 2020-11-26 23:54 HKT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;
		}
	}