[OpenLayers-Dev] Bug in ie7 (maybe ie6 also) in /OpenlLayers/lib/OpenLayers/Proptocol/HTTP.js on line 324:

aducos at hbs-research.com aducos at hbs-research.com
Mon Mar 16 06:20:46 EDT 2009


When I run openlayers in ie7 I have an error in
/OpenlLayers/lib/OpenLayers/Proptocol/HTTP.js on line 324:

'status' is Null or is not an object

This does not happen in firefox.

Now if I look closer to the code, it is a bug in a method 
'handleResponse' of the object OpenLayers.Protocol.HTTP
 the method begins like this:

handleResponse: function(resp, options) {
        var request = resp.priv;
        if(options.callback) {
            if(request.status >= 200 && request.status < 300) { ...

Now in my case I don't exactly know why resp.priv is null. So I just 
changed the code like this and all seams to work fine (in ie and firefox):

handleResponse: function(resp, options) {
        var request = resp.priv;
        if(options.callback) {
            if(request && request.status >= 200 && request.status < 300) 
{ ...

This would just check if request is not null before trying to see if 
there is a status with it. Anyway if "request" is null the status can 
not be >= 200 and < 300. So the corrected code is not wrong.



More information about the Dev mailing list