How can I solve NullPointerException for Calculated Value applied to Timestamp in RTC 3.0.1.1?
![]()
Hello,
I have a custom attribute of type timestamp and there is a calculated value attribute customization associated with it that will insert a date value based on certain conditions.
I have noticed that the script will throw a java.lang.NullPointerException when it doesn't meet the conditions for setting a date value, presumably because it won't accept "null" as a return value even though the value, if read from the attribute, is currently "null" (in some cases the attribute does not need to be set and so null should be valid).
Is there any way of programming the script so that the java.lang.NullPointerException doesn't appear?
I have tried to remove the return completely but that doesn't change anything.
Any ideas?
Regards,
Andrew
|
3 answers
![]()
Hello Eric,
Thank you for your interest. Since the comment is too small, I will give you the info here in a reply in the thread:
The NPE:
And the code is here:
When a new work item is created the script is run and it goes to the else statement which is "return null;". This throws the "java.lang.NullPointerException". I have even tried "return workItem.getValue(attributeId)" which the current value, but I get the same exception.
Best regards,
Andrew
|