laaglu / lib-gwt-svg

a general purpose SVG library for GWT. The goal is to make it easy to do SVG graphics in a GWT application
http://www.vectomatic.org/libs/lib-gwt-svg
39 stars 23 forks source link

Exception when trying to get unavailable element by id #7

Closed funsheep closed 10 years ago

funsheep commented 10 years ago

Tried to get an element by id, where no such element exists. Something like

OMSVGElement elem = widget.getSvgElement().getElementById("i do not exist");

The javadoc for the method states, that then null is returned. However, the above code does throw a JavaScriptException:

com.google.gwt.core.client.JavaScriptException: (TypeError) @org.vectomatic.dom.svg.OMNode::getWrapper(Lcom/google/gwt/dom/client/Node;)([null]): Cannot read property '__wrapper' of null

Tested with v0.5.8 and v0.5.9

paulord commented 10 years ago

I have experienced the same issue. getElementById always throws exception if id does not exist.

laaglu commented 10 years ago

Fixed in lib-gwt-svg-0.5.10-SNAPSHOT