"null" value is wrapped as Undefined.
Se Hee Lee
tosehee at gmail.com
Mon Jun 6 17:17:13 UTC 2022
Is there a way to prevent this automatic wrapping?
In the following line, "oh.customAttribute4" is null, and it's passed into
isBlank() as "Undefined". And that triggers the ClassCastException. This
works fine in JDK 1.8.0_91, but fails in all future versions.
Is there an optional parameter or flag that prevents this from
happening??????
We have lots of rules that are based on 'nashorn' scripting engine, and we
cannot upgrade to future JDK due to this issue.
if (oh.type == "Sales Order" && $S.isBlank(oh.customAttribute4) &&
oh.importType != "Transfer Order" && ol.item.customAttribute1 != "true" &&
$S.containsIgnoreCase(vars.highMovingItems, ol.item.number + ",") ||
$S.endsWithIgnoreCase(vars.highMovingItems, ol.item.number)) {
Caused by: java.lang.ClassCastException: Cannot cast
org.openjdk.nashorn.internal.runtime.Undefined to java.lang.CharSequence
--
Se Hee Lee / CTO
------------------------------
11605 Haynes Bridge Rd, Suite 200 | Alpharetta, GA 30009
470-214-3636 | slee at deposco.com | www.deposco.com
<https://deposco.com/?utm_source=Email%20Signature>
[image: Twitter] <https://twitter.com/deposco> [image: Facebook]
<https://facebook.com/deposco> [image: Google +]
<https://plus.google.com/+Deposco> [image: LinkedIn]
<https://www.linkedin.com/company-beta/384437/>
<https://deposco.com/?utm_source=Email%20Signature>
More information about the nashorn-dev
mailing list