Skip to content

Commit

Permalink
Merge pull request #194 from UnifierHQ/dev
Browse files Browse the repository at this point in the history
Quick fix for 3.8.0
  • Loading branch information
greeeen-dev authored Feb 10, 2025
2 parents ba757c4 + 1af904e commit a0c5c26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cogs/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,11 +1135,14 @@ async def restore(self,filename='bridge.json'):
# noinspection PyUnresolvedReferences
data = cog_storage.load(filename)
except json.JSONDecodeError:
# i could write the exceptions cleaner but i'm not bothered to
secure_load_success = False
except UnicodeDecodeError:
secure_load_success = False
except FileNotFoundError:
secure_load_success = False
except KeyError:
secure_load_success = False
else:
data = jsontools.loads_bytes(compressor.decompress(data, self.__bot.config['zstd_chunk_size']))
if not secure_load_success:
Expand All @@ -1155,6 +1158,8 @@ async def restore(self,filename='bridge.json'):
secure_load_success = False
except FileNotFoundError:
secure_load_success = False
except KeyError:
secure_load_success = False
else:
data = jsontools.loads_bytes(data)
if not secure_load_success:
Expand Down

0 comments on commit a0c5c26

Please sign in to comment.