Skip to content

Commit

Permalink
Update google.py
Browse files Browse the repository at this point in the history
Resolves:
`TypeError: 'NoneType' object is not subscriptable`
when 
`part = ['\n', None, None, None, None, None, '\n']`
  • Loading branch information
SamuelWN authored Apr 30, 2024
1 parent 373e889 commit ef44710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manga_translator/translators/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async def _request_and_parse_translation(self, query, to_lang, from_lang):
for part in parsed[1][0][0][5]:
try:
translated_parts.append(part[4][1][0])
except IndexError:
except (IndexError, TypeError):
translated_parts.append(part[0])
except IndexError:
translated_parts.append("")
Expand Down

0 comments on commit ef44710

Please sign in to comment.