ups-bug-fix

This commit is contained in:
Arndt Brenschede 2016-09-06 19:19:42 +02:00
parent ead7f2ac6d
commit f5b6e13a26

View file

@ -722,16 +722,16 @@ public final class OsmTrack
{ {
OsmPathElement e = element; OsmPathElement e = element;
int cnt = 0; int cnt = 0;
while( e != null ) while( e != null && e.origin != null )
{ {
if ( e.origin == root ) if ( e.origin.getILat() == root.getILat() && e.origin.getILon() == root.getILon() )
{ {
return e.message; return e.message;
} }
e = e.origin; e = e.origin;
if ( cnt++ == 1000000 ) if ( cnt++ == 1000000 )
{ {
throw new IllegalArgumentException( "ups?" ); throw new IllegalArgumentException( "ups: " + root + "->" + element );
} }
} }
return null; return null;