diff options
Diffstat (limited to 'app/lib/language_detector.rb')
-rw-r--r-- | app/lib/language_detector.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/lib/language_detector.rb b/app/lib/language_detector.rb index 302072bcc..05a06726d 100644 --- a/app/lib/language_detector.rb +++ b/app/lib/language_detector.rb @@ -52,8 +52,10 @@ class LanguageDetector def detect_language_code(text) return if unreliable_input?(text) + result = @identifier.find_language(text) - iso6391(result.language.to_s).to_sym if result.reliable? + + iso6391(result.language.to_s).to_sym if result&.reliable? end def iso6391(bcp47) |