From 876e7b574c9ad099fd00721aa92c79561d3eb2b7 Mon Sep 17 00:00:00 2001 From: lostystyg Date: Wed, 24 Aug 2022 15:35:47 +0400 Subject: [PATCH] Fixed crash if non-valid filters are specified for notifications/activities/events --- src/pocketdb/repositories/web/WebRpcRepository.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pocketdb/repositories/web/WebRpcRepository.cpp b/src/pocketdb/repositories/web/WebRpcRepository.cpp index 77d493cec..9f26b66bb 100644 --- a/src/pocketdb/repositories/web/WebRpcRepository.cpp +++ b/src/pocketdb/repositories/web/WebRpcRepository.cpp @@ -4762,6 +4762,10 @@ namespace PocketDb binds.emplace_back(select.second.binding); } } + + if (queryElems.empty()) { + throw std::runtime_error("Failed to construct query for requested filters"); + } queryElems.pop_back(); // Dropping last "union" std::stringstream ss;