//if day is sat/sun, set value to W. calendar.set(year,monthNumberForCalendar,dayOfMonth) if(contract.workingDays.id == mondayToFriday.id)
{
if(calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY){ monthMap.put(dayOfMonth, "W")
URI
/oulhr/leaveView/show
Class
java.lang.NullPointerException
Message
Cannot get property 'id' on null object
//leaveMonths = this.getLeaveMonths(year)
def employeeContract = new Contract()
employeeContract = this.getCurrentContract(employee) leaveMonths = this.getLeaveMonths(year,employeeContract)
/*add leave days to month(e.g Jan). When jan is filled up, add to the following month(.e.g Feb) */
int monthNumber = 0;
答案 0 :(得分:0)
错误消息很明确。
这是因为workingDays
或mondayToFriday
为空。
自信地说:
contract.workingDays.id = mondayToFriday.id
您必须先确保contract, contract.workingDays, mondayToFriday
不是null
。