From b1d0cb83eb369769be4708d0fabb95355150d86b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 8 Oct 2022 08:34:00 +0200 Subject: [PATCH] Fix privacy policy being empty if custom setting exists but is empty (#19318) --- app/models/privacy_policy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/privacy_policy.rb b/app/models/privacy_policy.rb index b93b6cf350..36cbf18822 100644 --- a/app/models/privacy_policy.rb +++ b/app/models/privacy_policy.rb @@ -68,7 +68,7 @@ class PrivacyPolicy < ActiveModelSerializers::Model def self.current custom = Setting.find_by(var: 'site_terms') - if custom + if custom&.value.present? new(text: custom.value, updated_at: custom.updated_at) else new(text: DEFAULT_PRIVACY_POLICY, updated_at: DEFAULT_UPDATED_AT)