deswaraj / gpxviewer

Automatically exported from code.google.com/p/gpxviewer
0 stars 0 forks source link

Error if a child element has no children in function CreateMarker #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Bug originally reported as a comment here
http://notions.okuda.ca/geotagging/projects-im-working-on/gpx-viewer/#comments

Hi,

I have found a small error in file loadgpx.4.js
(http://okuda.ca/googlemaps/loadgpx.4.js).
The error occurs in Internet Explorer with test file lewis_clark.gpx
(http://www.travelbygps.com/guides/lewis_clark/lewis_clark.gpx).
In function CreateMarker empty nodes are ignored by testing for nodeType =
1 (elements only).
However, an elemement "link" may still have no children, such as in
lewis_clark.gpx:

In that case, firstChild is null and an error occurs (firstChild.nodeValue).

To capture this exception, an extra test is needed:

115     // Ignore empty nodes
116     if (children[i].nodeType != 1) continue;
117     if (children[i].firstChild == null) continue; // ";

bye,
Gerben Abbink
www.xmlblueprint.com

Original issue reported on code.google.com by kok...@gmail.com on 31 Jul 2007 at 4:15

GoogleCodeExporter commented 8 years ago

Original comment by kok...@gmail.com on 31 Jul 2007 at 4:25