diff --git a/app/controllers/upgrade_controller.rb b/app/controllers/upgrade_controller.rb index 679c74e..cb6ffc4 100644 --- a/app/controllers/upgrade_controller.rb +++ b/app/controllers/upgrade_controller.rb @@ -52,8 +52,8 @@ class UpgradeController < ApplicationController } end text = {"en" => "", "zh_tw" => ""} - text["en"] = smart_convertor(b.text_translations["en"]) if !b.text_translations["en"].nil? - text["zh_tw"] = smart_convertor(b.text_translations["zh_tw"]) if !b.text_translations["en"].nil? + text["en"] = (b.text_translations["en"].nil? ? "" :smart_convertor(b.text_translations["en"])) + text["zh_tw"] = (b.text_translations["zh_tw"].nil? ? "" : smart_convertor(b.text_translations["zh_tw"])) { "id" => b.id.to_s,