Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Add conditional for None in geoip plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnbus committed Oct 28, 2019
1 parent b6843d6 commit bf804f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mq/plugins/geoip.py
Expand Up @@ -56,8 +56,8 @@ def onMessage(self, message, metadata):
message['details'][geo_key] = self.ipLocation(ipText)
# Add a geo_point coordinates if latitude and longitude exist
if 'latitude' in message['details'][geo_key] and 'longitude' in message['details'][geo_key]:
if message['details'][geo_key]['latitude'] != '' and message['details'][geo_key]['latitude'] != 'None' and \
message['details'][geo_key]['longitude'] != '' and message['details'][geo_key]['latitude'] != 'None':
if message['details'][geo_key]['latitude'] and message['details'][geo_key]['latitude'] != '' and \
message['details'][geo_key]['longitude'] and message['details'][geo_key]['longitude'] != '':
geopoint_key = '{0}ipgeopoint'.format(key)
message['details'][geopoint_key] = '{0},{1}'.format(
message['details'][geo_key]['latitude'],
Expand Down

0 comments on commit bf804f9

Please sign in to comment.