Skip to content

Commit 4271fea

Browse files
authored
Fix bug that returns attribute error when lat or long is exactly 0 (#44)
* Fix bug that returns attribute error when lat or long is exactly 0 * replace '!= None' with 'is not None'
2 parents db795b3 + 92d5070 commit 4271fea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flask_googlemaps/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ def build_marker_dict(self, marker, icon=None):
9898
return marker_dict
9999

100100
def add_marker(self, lat=None, lng=None, **kwargs):
101-
if lat:
101+
if lat is not None:
102102
kwargs['lat'] = lat
103-
if lng:
103+
if lng is not None:
104104
kwargs['lng'] = lng
105105
if 'lat' not in kwargs or 'lng' not in kwargs:
106106
raise AttributeError('lat and lng required')

0 commit comments

Comments
 (0)