Fixed some crashes

This commit is contained in:
WolverinDEV 2020-02-18 11:53:33 +01:00
parent 6479e31435
commit 0fccd957b6
3 changed files with 8 additions and 4 deletions

View File

@ -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!");

View File

@ -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};
}
}

2
shared

@ -1 +1 @@
Subproject commit e500f8c0aa2e5b132aa3427aaaf0311b9d49036a
Subproject commit 72661d17bc59c5710e2d8c564d2315db41e8f3fc