commit: 8ebed7fc68bed3e3a1327294588ec234ff5b2482
parent: 8f2ed79a0b25db547020c0e0b664a94d6bee1c8f
Author: Eugen <eugen@zeonfederated.com>
Date: Sun, 16 Apr 2017 23:12:19 +0200
Fix #1957 - WhatLanguage can return null. Fallback to 'en' (#1959)
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
@@ -53,7 +53,7 @@ class PostStatusService < BaseService
end
def detect_language(text)
- WhatLanguage.new(:all).language_iso(text)
+ WhatLanguage.new(:all).language_iso(text) || 'en'
end
def process_mentions_service