From 97ec685d169289147cc4d46d89a376f283f119c7 Mon Sep 17 00:00:00 2001 From: Markus Holtermann Date: Sat, 26 Jan 2013 00:04:54 +0100 Subject: Fix null pointer exception --- bvggrabber/api/actualdeparture.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bvggrabber/api/actualdeparture.py') diff --git a/bvggrabber/api/actualdeparture.py b/bvggrabber/api/actualdeparture.py index 7cdac17..f6f5fe2 100644 --- a/bvggrabber/api/actualdeparture.py +++ b/bvggrabber/api/actualdeparture.py @@ -38,7 +38,10 @@ class ActualDepartureQueryApi(QueryApi): return (False, []) else: # The station seems to exist - rows = soup.find('tbody').find_all('tr') + tbody = soup.find('tbody') + if tbody is None: + return (False, []) + rows = tbody.find_all('tr') departures = [] for row in rows: tds = row.find_all('td') -- cgit v1.2.3