From 0fccd957b61a54846eb4ddf97c2dbad6ad41cc5b Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Tue, 18 Feb 2020 11:53:33 +0100 Subject: [PATCH] Fixed some crashes --- license/shared/LicenseRequestHandler.cpp | 8 ++++++-- server/src/client/command_handler/misc.cpp | 2 +- shared | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/license/shared/LicenseRequestHandler.cpp b/license/shared/LicenseRequestHandler.cpp index 198c49d..0366e29 100644 --- a/license/shared/LicenseRequestHandler.cpp +++ b/license/shared/LicenseRequestHandler.cpp @@ -15,7 +15,9 @@ void LicenceRequest::handlePacketDisconnect(const std::string& message) { * Test if we have a result. If so and the license is invalid then we could use that result */ if(this->response && !this->response->license_valid) { - this->currentFuture->executionSucceed(this->response); + try { + this->currentFuture->executionSucceed(this->response); + } catch(threads::InvalidFutureException& ex) {} } else { LICENSE_FERR(this, UnexcpectedDisconnectException, "Remote side closed the connection unexpectedly (" + message + ")"); } @@ -119,7 +121,9 @@ void LicenceRequest::handlePacketInfoAdjustment(const std::string& message) { this->callback_update_certificate(cert); } - this->currentFuture->executionSucceed(this->response); + try { + this->currentFuture->executionSucceed(this->response); + } catch(threads::InvalidFutureException& ex) {} this->response = nullptr; this->disconnect("query succeeded!"); diff --git a/server/src/client/command_handler/misc.cpp b/server/src/client/command_handler/misc.cpp index 2198846..e6d042c 100644 --- a/server/src/client/command_handler/misc.cpp +++ b/server/src/client/command_handler/misc.cpp @@ -2503,7 +2503,7 @@ command_result ConnectedClient::handleCommandConversationMessageDelete(ts::Comma if (!permission::v2::permission_granted(1, this->calculate_permission(permission::b_channel_conversation_message_delete, 1, channel->channelId()))) return command_result{permission::b_channel_conversation_message_delete}; - if(auto error_perm = this->calculate_and_get_join_state(channel); error_perm && error_perm != permission::b_client_is_sticky) + if(auto error_perm = this->calculate_and_get_join_state(channel); error_perm != permission::ok && error_perm != permission::b_client_is_sticky) return command_result{error_perm}; } } diff --git a/shared b/shared index e500f8c..72661d1 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit e500f8c0aa2e5b132aa3427aaaf0311b9d49036a +Subproject commit 72661d17bc59c5710e2d8c564d2315db41e8f3fc