diff --git a/platypush/message/request/__init__.py b/platypush/message/request/__init__.py index e8863263c7..127fd9f70c 100644 --- a/platypush/message/request/__init__.py +++ b/platypush/message/request/__init__.py @@ -135,7 +135,10 @@ class Request(Message): else: 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: logging.exception(e) parsed_value += prefix + expr diff --git a/platypush/plugins/google/maps.py b/platypush/plugins/google/maps.py index 55eb7f5f15..a5ca675e6d 100644 --- a/platypush/plugins/google/maps.py +++ b/platypush/plugins/google/maps.py @@ -44,7 +44,11 @@ class GoogleMapsPlugin(GooglePlugin): address['postal_code'] = addr_component['long_name'] 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']) return Response(output=address)