mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
Dirty fix for infinite loop
Changed back `continue wpoints_loop` to `break wpoints_loop` because it causes an infinite loop once `wpt_i` reaches `wpoints.length` and `wpoints[wpt_i]` is undefined , yet it continues to loop for some reason. Break is not nice because there could be defined values for bigger wpt_i Attempt to understand why with `console.log(wpoints.length)`.
This commit is contained in:
parent
92f346b1ca
commit
bc7ffb39b5
@ -396,9 +396,10 @@ export class GalleryMapLightboxComponent implements OnChanges {
|
||||
this.mapLayersControlOption.overlays.Paths.addLayer(polyline(path as LatLng[]));
|
||||
}
|
||||
if (wpoints.length !== 0) {
|
||||
console.log("wpoints.length=" + wpoints.length);
|
||||
wpoints_loop: for (let wpt_i = 0; i < wpoints.length; wpt_i++) {
|
||||
if (wpoints[wpt_i] === undefined) {
|
||||
continue wpoints_loop;
|
||||
break wpoints_loop;
|
||||
}
|
||||
this.mapLayersControlOption.overlays.Paths.addLayer(marker(wpoints[wpt_i] as LatLng));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user