Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    JSOHelper.getAttributeAsIntArray on empty set - bug?

    calling Record.getAttributeAsIntArray on record with null value blows up. (probably similar bugs in other 'asXArray' methods). Expected: should return null.

    workaround, call getAttribute(), check for null (actually String.length()==0), then call getAttributeAsIntArray

    Code:
    com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.smartgwt.client.util.JSOHelper::getIntValueFromJavaScriptObjectArray(Lcom/google/gwt/core/client/JavaScriptObject;I)': JS value of type null, expected int
    	at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
    	at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
    Last edited by atomatom; 4 Jul 2011, 06:23.

    #2
    Please post the context and relevant code. What appears to be happening is that one of the elements in the array is null which is a problem because the API returns an int[] which cannot hold null, and defaulting null to 0 can introduce hidden bugs. Try to identify why the JS array may have a null value.

    Sanjiv

    Comment


      #3
      I'll see if I can dig deeper on to see if it was an array of nulls

      Comment

      Working...
      X