Skip to content

Commit

Permalink
Hotfix of unhandled exception by language_tool_python (#870)
Browse files Browse the repository at this point in the history
Signed-off-by: TheJackiMonster <[email protected]>
  • Loading branch information
TheJackiMonster committed Apr 30, 2021
1 parent 9bdd80f commit 7e05b72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions manuskript/functions/spellchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,10 @@ def __init__(self, name):
@staticmethod
def getTool():
if LanguageToolDictionary._tool == None:
LanguageToolDictionary._tool = languagetool.LanguageTool()
try:
LanguageToolDictionary._tool = languagetool.LanguageTool()
except:
return None

return LanguageToolDictionary._tool

Expand All @@ -569,7 +572,7 @@ def getLibraryURL():

@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.
Expand Down

0 comments on commit 7e05b72

Please sign in to comment.