Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Commit

Permalink
fix 'NoneType' object has no attribute 'split'
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Jul 15, 2019
1 parent 7bb543f commit a693776
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions custom_components/here_travel_time/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ def update(self):
else:
traffic_mode = TRAFFIC_MODE_DISABLED

# Convert location to HERE friendly location if not already so
if not isinstance(self.destination, list):
self.destination = self.destination.split(',')
if not isinstance(self.origin, list):
self.origin = self.origin.split(',')

if self.destination is not None and self.origin is not None:
# Convert location to HERE friendly location if not already so
if not isinstance(self.destination, list):
self.destination = self.destination.split(',')
if not isinstance(self.origin, list):
self.origin = self.origin.split(',')

response = self._client.car_route(
self.origin,
self.destination,
Expand Down

0 comments on commit a693776

Please sign in to comment.