From 7689f7dd2c19d3b1ba03c19bf820e9c6080ec8c0 Mon Sep 17 00:00:00 2001 From: Pawel Olejniczak Date: Thu, 6 Aug 2020 10:05:41 +0200 Subject: [PATCH] [EGD-3488] Remove incorrect verification of contact numbers received from db --- module-db/Interface/ContactRecord.cpp | 4 ++-- module-db/Tables/Record.hpp | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module-db/Interface/ContactRecord.cpp b/module-db/Interface/ContactRecord.cpp index 9bb403cb4..3fcd05d0b 100644 --- a/module-db/Interface/ContactRecord.cpp +++ b/module-db/Interface/ContactRecord.cpp @@ -307,9 +307,9 @@ ContactRecord ContactRecordInterface::GetByID(uint32_t id) return rec; } - std::vector nrs = getNumbers(contact.numbersID); + auto nrs = getNumbers(contact.numbersID); if (nrs.size() == 0) { - return rec; + LOG_DEBUG("Contact record does not contain any numbers."); } auto ring = contactDB->ringtones.getById(contact.ringID); if (!ring.isValid()) { diff --git a/module-db/Tables/Record.hpp b/module-db/Tables/Record.hpp index 8cc9bc781..d4af0d5b5 100644 --- a/module-db/Tables/Record.hpp +++ b/module-db/Tables/Record.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include constexpr uint32_t DB_ID_NONE = 0; @@ -10,6 +11,10 @@ struct Record bool isValid() const { - return ID != DB_ID_NONE; + auto result = ID != DB_ID_NONE; + if (!result) { + LOG_ERROR("Record validation failed - incorrect ID"); + } + return result; } };