diff --git a/plugins/sms/conversationsdbusinterface.cpp b/plugins/sms/conversationsdbusinterface.cpp index b2b95674b..ff68e6f75 100644 --- a/plugins/sms/conversationsdbusinterface.cpp +++ b/plugins/sms/conversationsdbusinterface.cpp @@ -91,6 +91,16 @@ QVariantList ConversationsDbusInterface::activeConversations() void ConversationsDbusInterface::requestConversation(const qint64& conversationID, int start, int end) { + if (start < 0 || end < 0) { + qCWarning(KDECONNECT_CONVERSATIONS) << "requestConversation" << "Start and end must be >= 0"; + return; + } + + if (end - start < 0) { + qCWarning(KDECONNECT_CONVERSATIONS) << "requestConversation" <<"Start must be before end"; + return; + } + RequestConversationWorker* worker = new RequestConversationWorker(conversationID, start, end, this); connect(worker, &RequestConversationWorker::conversationMessageRead, this, &ConversationsDbusInterface::conversationUpdated,