From 94472ba945d4aa730cafd1fa24e9b5b095f7e4f4 Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 7 Oct 2022 13:51:37 +0200 Subject: [PATCH] Fixed the case when stations is None --- pyrmv/classes/Client.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pyrmv/classes/Client.py b/pyrmv/classes/Client.py index 042de9a..b384286 100644 --- a/pyrmv/classes/Client.py +++ b/pyrmv/classes/Client.py @@ -198,12 +198,14 @@ class Client(): if isinstance(station_to, Stop): station_to = station_to.ext_id - new_stations = [] - for stop in stations: - if isinstance(stop, Stop): - new_stations.append(stop.ext_id) - else: - new_stations.append(stop) + if stations != None: + new_stations = [] + for stop in stations: + if isinstance(stop, Stop): + new_stations.append(stop.ext_id) + else: + new_stations.append(stop) + stations = new_stations if search_mode == None: search_mode = None @@ -235,7 +237,7 @@ class Client(): companies=companies, lines=lines, lineids=line_ids, - stations=new_stations, + stations=stations, fromstation=station_from, tostation=station_to, bothways=both_ways,