cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Rhino warning when referencing a ValueCollection

agondek
12-Amethyst

Rhino warning when referencing a ValueCollection

I get this warning:

 

"Execution error in service script [blah] :: RHINO USAGE WARNING: Missed Context.javaToJS() conversion:_Rhino runtime detected object of class com.thingworx.types.collections.ValueCollection where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call."

 

after running the below generalized code:

var foundRow = infotable.Find(object);
if (foundRow !== undefined && foundRow !== null) {
            logger.info(foundRow.field);
}

I believe its telling me that the foundRow variable is a ValueCollection and I shouldn't be referencing it. However, the foundRow.field is returning the value I expect it to. Is there anyway to suppress or avoid this Rhino usage warning?

3 REPLIES 3
agondek
12-Amethyst
(To:agondek)

I found this support Article referencing a similar issue but it doesn't actually provide a resolution nor is my code comparing the Object to a String like the Article says with this line:

 

tempObject = heatMapInfoTable.Find(obj); /* tempObject is an object but compared to a String in the below if statement which caused Rhino messages */
        if(tempObject!= undefined && tempObject!=null && tempObject!=''){
        }
posipova
20-Turquoise
(To:agondek)

In the article linked above, the resolution suggests checking for a null variable explicitly,

var myVar = Things["myThing"];     // myVar is populated with a Thing Object

if (myVar != null) {

     // Do stuff here

}
agondek
12-Amethyst
(To:posipova)

Hi,

 

In my initial post I noted that I already check for the null variable explicitly. It does not resolve the error.

Announcements


Top Tags