[GeoNetwork-devel] Probable bug in intermap script im_class.js [SEC=UNCLASSIFIED]

Folks,

It seems to me that there is a bug in the intermap script, im_class.js.

The bug appears at line 178, in the function getURLbbox. The code fragment:

if(this.north)

return MapUtils……

else

return null;

will return null if this.north has the value null OR if this.north is 0 (i.e. the equator).

I suggest the test be changed to:

if(this.north != null)

Regards,

Steve

Stephen.Davies@anonymised.com wrote:

> It seems to me that there is a bug in the intermap script, im_class.js.
>
> The bug appears at line 178, in the function getURLbbox. The code fragment:
>
> if(this.north)
>
> return MapUtils……
>
> else
>
> return null;
>
> will return null if this.north has the value null OR if this.north is 0 (i.e. the equator).

In my own working copy I had already changed the test to:

     if(this.north != undefined)

It "works for me". The differences between
null and undefined are subtle and even
after reading the section in Flanagan's
book several times I'm still not sure
which one is the "right" one to use here.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082