Private
Public Access
1
0

fixing errors

This commit is contained in:
2024-06-06 19:26:46 +02:00
parent 32272f0ea6
commit c42bc00f42
2 changed files with 12 additions and 6 deletions

View File

@@ -80,11 +80,14 @@ def getnearestcourses(lat_lon, courses, whatisnear=150, strict=False):
newlist = []
counter = 0
for c in courses:
distance = howfaris(lat_lon, c)
try:
distance = howfaris(lat_lon, c)
if distance < whatisnear:
newlist.append(c)
counter += 1
if distance < whatisnear:
newlist.append(c)
counter += 1
except TypeError:
pass
if counter > 0:
courses = newlist