Fix #2283 : Potential for sessionproxy keyerror with newly added torrents

This commit is contained in:
Calum Lind 2013-02-21 22:47:30 +00:00
parent e2e37a83de
commit 9856f97323

View File

@ -135,7 +135,7 @@ class SessionProxy(component.Component):
keys = self.torrents[torrent_id][1].keys()
for key in keys:
if time.time() - self.cache_times[torrent_id][key] > self.cache_time:
if time.time() - self.cache_times[torrent_id].get(key, 0.0) > self.cache_time:
keys_to_get.append(key)
if not keys_to_get: