Skip to content

Commit

Permalink
Don't break if source is missing (#6)
Browse files Browse the repository at this point in the history
This broke for very old checkins from 2010 with no source set. Thanks, @mfa!
  • Loading branch information
mfa committed Mar 28, 2020
1 parent dfb6826 commit d3c4ab2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swarm_to_sqlite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def save_checkin(checkin, db):
checkin["created"] = datetime.datetime.utcfromtimestamp(
checkin["createdAt"]
).isoformat()
checkin["source"] = db["sources"].lookup(checkin["source"])
checkin["source"] = db["sources"].lookup(checkin["source"]) if "source" in checkin else None
users_with = checkin.pop("with", None) or []
users_likes = []
for group in checkin["likes"]["groups"]:
Expand Down

0 comments on commit d3c4ab2

Please sign in to comment.