diff --git a/build-tor.py b/build-tor.py
index 77e50ee13b306e576d076c7448716d3ad1d6dfb3..6fa4e309d2b9e8247d6587162c85dbdd20d9445d 100755
--- a/build-tor.py
+++ b/build-tor.py
@@ -273,8 +273,8 @@ def pack(versions, file_list, android=False):
 
 
 def reset_time(filename, versions):
-    timestamp = versions['timestamp']
-    if timestamp is None: timestamp = '197001010000.00'
+    if 'timestamp' in versions: timestamp = versions['timestamp']
+    else: timestamp = '197001010000.00'
     check_call(['touch', '--no-dereference', '-t', timestamp, filename])