forked from platypush/platypush
Prevent plugins from breaking in case of concatenations with None elements
This commit is contained in:
parent
21ac8d7899
commit
9923742e74
2 changed files with 9 additions and 2 deletions
|
@ -135,7 +135,10 @@ class Request(Message):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
parsed_value += prefix + eval(inner_expr)
|
expanded_expr = eval(inner_expr)
|
||||||
|
parsed_value += prefix
|
||||||
|
if expanded_expr is not None:
|
||||||
|
parsed_value += expanded_expr
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception(e)
|
logging.exception(e)
|
||||||
parsed_value += prefix + expr
|
parsed_value += prefix + expr
|
||||||
|
|
|
@ -44,7 +44,11 @@ class GoogleMapsPlugin(GooglePlugin):
|
||||||
address['postal_code'] = addr_component['long_name']
|
address['postal_code'] = addr_component['long_name']
|
||||||
|
|
||||||
if 'address' in address and 'street_number' in address:
|
if 'address' in address and 'street_number' in address:
|
||||||
address['address'] += ' ' + address['street_number']
|
address['address'] = '{}{}{}'.format(
|
||||||
|
(address['address'] or ''),
|
||||||
|
(' ' if address['street_number'] else ''),
|
||||||
|
(address['street_number'] or ''))
|
||||||
|
|
||||||
del(address['street_number'])
|
del(address['street_number'])
|
||||||
|
|
||||||
return Response(output=address)
|
return Response(output=address)
|
||||||
|
|
Loading…
Reference in a new issue