Skip to content

Commit

Permalink
Change check on countries to handle empty lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Saulios committed Dec 24, 2024
1 parent 868332c commit edf8b83
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions EpicGame.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ def blacklisted_countries(self, game):
if game["customAttributes"]:
key_to_find = 'com.epicgames.app.blacklist'
blacklisted_countries_string = next((item['value'] for item in game["customAttributes"] if item['key'] == key_to_find), None)
if blacklisted_countries_string is not None:
blacklisted_countries_string = re.sub(r'[\W_]+', u'', blacklisted_countries_string, flags=re.UNICODE)
if blacklisted_countries_string:
blacklisted_countries = self.get_country_names(blacklisted_countries_string.split(","))
if blacklisted_countries_string is not None and blacklisted_countries_string != "[]":
blacklisted_countries = self.get_country_names(blacklisted_countries_string.split(","))
return blacklisted_countries

def get_country_names(self, country_list):
Expand Down

0 comments on commit edf8b83

Please sign in to comment.