diff options
author | AKalinich-Luxoft <AKalinich@luxoft.com> | 2017-06-15 14:39:58 +0300 |
---|---|---|
committer | AKalinich-Luxoft <AKalinich@luxoft.com> | 2017-06-15 14:39:58 +0300 |
commit | 5ba351b575d5f831c2058a7a1dca578713ba66c0 (patch) | |
tree | 8a14777e4850aee33f7afd8422349f115e713456 /src/components/policy/policy_regular | |
parent | 817052ffe35991d6927e9176528821323b4e6812 (diff) | |
download | sdl_core-5ba351b575d5f831c2058a7a1dca578713ba66c0.tar.gz |
Fix consumer friendly messages removing from PT
In case PTU comes with omitted consumer_friendly_messages param
SDL should maintain current consumer_friendly_messages section
in Local PT.
Diffstat (limited to 'src/components/policy/policy_regular')
-rw-r--r-- | src/components/policy/policy_regular/src/sql_pt_representation.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index e94c853414..18d8975d15 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -1177,9 +1177,11 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( // the policy table. So it won't be changed/updated if (messages.messages.is_initialized()) { utils::dbms::SQLQuery query(db()); - if (!query.Exec(sql_pt::kDeleteMessageString)) { - LOG4CXX_WARN(logger_, "Incorrect delete from message."); - return false; + if (!messages.messages->empty()) { + if (!query.Exec(sql_pt::kDeleteMessageString)) { + LOG4CXX_WARN(logger_, "Incorrect delete from message."); + return false; + } } if (query.Prepare(sql_pt::kUpdateVersion)) { |