PDA

View Full Version : 'r.xhr undefined' exception in 1.1.0



alikic
27 Apr 2011, 10:01 AM
Environment:
Safari 5.0.4 on Win7-64 and XOS
Sencha Touch 1.1.0

In an effort to discover hidden runtime errors, I overrode windows.setTimeout(), where the new method wraps the original windows.setTimeout() in a try/catch block and reports any exception caught. Immediately, I started getting the following exception:

TypeError: Result of expression 'r.xhr' [undefined] is not an object.

I traced the error to the following code:



isLoading : function(r) {
return r && !{0:true, 4:true}[r.xhr.readyState];
},


It seams that sometimes, during the ajax timeout handling, r.xhr is not defined. As a temporary fix (until the bug is fixed in the official sencha touch release), I replaced the code with



isLoading : function(r) {
return r && r.xhr && !{0:true, 4:true}[r.xhr.readyState];
//return r && !{0:true, 4:true}[r.xhr.readyState];
},


Can you please confirm that this is really a bug in 1.1.0? Also, do you expect this change to have any negative effect?

Thanks,
Aleks