Commit 115ba414 authored by Kristian Tan's avatar Kristian Tan

Null check

parent 7dc43907
......@@ -83,7 +83,7 @@ def toggle_pin(change_pin):
# Create datetime object from formatted time
start_date = datetime.strptime(start_date_string, '%Y-%m-%d')
if latest_entry.date == start_date:
if latest_entry and latest_entry.date == start_date:
print("SECS BEFORE UPDATE")
print(latest_entry.on_time_seconds)
latest_entry.on_time_seconds += elapsed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment