From 8ebed7fc68bed3e3a1327294588ec234ff5b2482 Mon Sep 17 00:00:00 2001 From: Eugen Date: Sun, 16 Apr 2017 23:12:19 +0200 Subject: [PATCH] Fix #1957 - WhatLanguage can return null. Fallback to 'en' (#1959) --- app/services/post_status_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index d8202bea8..ec2b90e07 100644 --- 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