Issue 617 in svgweb: Null Reference Error in Clean-Up Code (IE9 Standards Mode)

9 views
Skip to first unread message

svg...@googlecode.com

unread,
May 24, 2011, 4:54:01 PM5/24/11
to svg-w...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Low

New issue 617 by joshua.p...@gmail.com: Null Reference Error in Clean-Up
Code (IE9 Standards Mode)
http://code.google.com/p/svgweb/issues/detail?id=617

What steps will reproduce the problem?
1. Load a page with svgweb in IE9 Standards mode
2. Navigate away or refresh
3. the method '_fireUnload', has the
line: 'svgweb.handlers[i].document.documentElement = null;' but the
document is null.

What is the expected output? What do you see instead?
Expect no errors.

What version of the product are you using? On what operating system,
browser, and version of Flash?


Please provide any additional information below. Reduced test cases are
always appreciated!

Just needs a null check, I guess.


svg...@googlecode.com

unread,
Feb 5, 2012, 4:27:08 AM2/5/12
to svg-w...@googlegroups.com

Comment #1 on issue 617 by kajmagnu...@gmail.com: Null Reference Error in
Clean-Up Code (IE9 Standards Mode)
http://code.google.com/p/svgweb/issues/detail?id=617

I'm also experiencing this error. I worked around it like so:


On svg.js, on line 51, change from:
...else svgweb.handlers[a].document.documentElement=null;...
to:
...else{try{svgweb.handlers[a].document.documentElement=null}catch(x){}};...

Then however another error happened in that "_fireUnload" function, on the
same minified line, no 51, for this piece of code:
if(b=document.getElementById("__htc_container")){
this error (deeper down the stack):
SCRIPT438: Object doesn't support property or method 'setProperty'
svg.js, line 1 character 319

So I added another try-catch-ignore block, around the whole "delete the HTC
container" code paragraph (see
http://code.google.com/p/svgweb/source/browse/trunk/src/svg.js#2126 )

So this minified code:
if(b=document.getElementById("__htc_container")){for(a=0;a<b.childNodes.length;a++){var
c=b.childNodes[a];if(c.nodeType==1&&c.namespaceURI==svgns){c.detachEvent("onpropertychange",c._fakeNode.style._changeListener);c.style.item=null;c.style.setProperty=null;c.style.getPropertyValue=null}if(c._fakeNode)c._fakeNode._htcNode=null;c._fakeNode=null;c._handler=
null}b.parentNode.removeChild(b)};

became this:
try{if(b=document.getElementById("__htc_container")){for(a=0;a<b.childNodes.length;a++){var
c=b.childNodes[a];if(c.nodeType==1&&c.namespaceURI==svgns){c.detachEvent("onpropertychange",c._fakeNode.style._changeListener);c.style.item=null;c.style.setProperty=null;c.style.getPropertyValue=null}if(c._fakeNode)c._fakeNode._htcNode=null;c._fakeNode=null;c._handler=
null}b.parentNode.removeChild(b)}}catch(x){};

And now it works just fine :-) or so I hope. (That is, no exceptions and
error dialogs when I reload my Web page in IE 9.)

Best regards, KajMagnus


svg...@googlecode.com

unread,
Feb 5, 2012, 5:03:15 AM2/5/12
to svg-w...@googlegroups.com

Comment #2 on issue 617 by kajmagnu...@gmail.com: Null Reference Error in

There's a patch, that solves another issue, and this issue too:
http://code.google.com/p/svgweb/issues/detail?id=616#c3

(I reverted all changes I did, and used the patched version, and now
there's no error.)

Reply all
Reply to author
Forward
0 new messages