From 824f2f1d0fe01d4858df59de3e8a49a9f9198dfc Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 21 Mar 2017 16:32:32 -0400 Subject: [PATCH] handle not being able to decode claim cache file --- lbrynet/lbrynet_daemon/Daemon.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 2365f54c0..d106704bb 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -350,9 +350,13 @@ class Daemon(AuthJSONRPCServer): name_cache_filename = os.path.join(self.db_dir, "stream_info_cache.json") if os.path.isfile(name_cache_filename): - with open(name_cache_filename, "r") as name_cache: - self.name_cache = json.loads(name_cache.read()) - log.info("Loaded claim info cache") + with open(name_cache_filename, "r") as name_cache_file: + name_cache = name_cache_file.read() + try: + self.name_cache = json.loads(name_cache) + log.info("Loaded claim info cache") + except ValueError: + log.warning("Unable to load claim info cache") def _check_network_connection(self): self.connected_to_internet = utils.check_connection()