PDA

View Full Version : [OPEN-1350] [3.3.0] Ext.elCache throws exception in IE



simonwg
20 Oct 2010, 6:20 PM
Ext version tested:


Ext 3.3.0
Ext 3.2.2



Adapter used:


ext



css used:


only default ext-all.css





Browser versions tested against:


IE8



Operating System:


WinXP Pro



Description:


I tried to copy the ExtJS API documentation sample as my application infrastructure. In IE 8, the ExtJS core might occassionaly throws the following error: Message: 'a[...].data' is null or not an object.



Test Case:
Typically, the following error throws when I click the tree node (ExtJS 3.2.x) or when I click the border's splitbar (ExtJS 3.2.x and 3.3.0). The exception would not be thrown when the application is first launched, but have to wait for a few seconds first (I think the internal cache might purge the objects after waiting for a few seconds)



Message: 'a[...].data' is null or not an object
Line: 7
Char: 22955
Code: 0
URI: http://someurl/resources/ext3/ext-all.js
After I trace the source code for a while, I found that the problem is from the code



El.data = function(el, key, value){
el = El.get(el);
if (!el) {
return null;
}
var c = EC[el.id].data; // EC[el.id] might be undefined for some cases
if(arguments.length == 2){
return c[key];
}else{
return (c[key] = value);
}
};
EC[el.id] might be null or undefined in some case, which cause the exception be thrown.

See this URL : http://


Steps to reproduce the problem:


The result that was expected:


The result that occurs instead:


Screenshot or Video:


Debugging already done:


none



Possible fix:
Add the checking to verify EC[el.id] is defined first seems works fine.


El.data = function(el, key, value){
el = El.get(el);
if (!el) {
return null;
}
if (EC[el.id]) {
var c = EC[el.id].data;
if(arguments.length == 2){
return c[key];
}else{
return (c[key] = value);
}
}
};