Hotfix of unhandled exception by language_tool_python (#870)

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
TheJackiMonster 2021-04-30 20:46:30 +02:00
parent 9bdd80f244
commit 7e05b72d83
No known key found for this signature in database
GPG key ID: D850A5F772E880F9

View file

@ -552,7 +552,10 @@ class LanguageToolDictionary(BasicDictionary):
@staticmethod
def getTool():
if LanguageToolDictionary._tool == None:
LanguageToolDictionary._tool = languagetool.LanguageTool()
try:
LanguageToolDictionary._tool = languagetool.LanguageTool()
except:
return None
return LanguageToolDictionary._tool
@ -569,7 +572,7 @@ class LanguageToolDictionary(BasicDictionary):
@staticmethod
def isInstalled():
if languagetool != None:
if (languagetool != None) and (LanguageToolDictionary.getTool() != None):
# This check, if Java is installed, is necessary to
# make sure LanguageTool can be run without problems.