fix crash on trying to convert *very* old 0.5 config files

This commit is contained in:
Marcos Pinto 2009-01-06 02:42:08 +00:00
commit 3584fa9e41

View file

@ -76,6 +76,10 @@ class OldStateUpgrader:
log.debug("Unable to open 0.5 state file: %s", e) log.debug("Unable to open 0.5 state file: %s", e)
return return
if type(state).__name__ == 'list':
log.debug("0.5 state file is too old to upgrade:")
return
else:
new_state = deluge.core.torrentmanager.TorrentManagerState() new_state = deluge.core.torrentmanager.TorrentManagerState()
for ti, uid in state.torrents.items(): for ti, uid in state.torrents.items():
torrent_path = os.path.join(self.config["config_location"], "torrentfiles", ti.filename) torrent_path = os.path.join(self.config["config_location"], "torrentfiles", ti.filename)