Check range is valid before plotting a route

This commit is contained in:
CMDR-Kiel42 2019-08-10 16:55:14 +02:00
parent d99a85d279
commit c707021bee

View File

@ -321,7 +321,12 @@ class SpanshRouter():
if ( source and source != self.source_ac.placeholder and
dest and dest != self.dest_ac.placeholder ):
range_ly = float(self.range_entry.get())
try:
range_ly = float(self.range_entry.get())
except ValueError:
self.show_error("Invalid range")
return
job_url="https://spansh.co.uk/api/route?"
results = requests.post(job_url, params={