Skip to content

Commit

Permalink
fix: add check if path exists before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
d-Rickyy-b committed Feb 22, 2021
1 parent d587910 commit add040c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions blackjackbot/lang/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,14 @@ def load_strings_from_dir(directory):

def reload_strings():
for path in language_paths:
if not path.exists():
logger.warning("The path for translations does not exist: {0}".format(path.name))
continue
load_strings_from_dir(path)

if len(languages) == 0:
logger.error("Coudln't load translations!")


def get_available_languages():
"""Return a list of available languages"""
Expand Down

0 comments on commit add040c

Please sign in to comment.