mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-16 19:02:32 +12:00
Hotfix of unhandled exception by language_tool_python (#870)
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
9bdd80f244
commit
7e05b72d83
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue