fix: Fix regression in ConnectAttempt (#5900)

A regression was introduced in #5669 which would cause rippled to potentially dereference a disengaged std::optional when connecting to a peer. This would cause UB in release build and crash in debug.

Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
This commit is contained in:
Bronek Kozicki
2025-10-16 13:54:36 +01:00
committed by GitHub
parent 640ce4988f
commit e80642fc12

View File

@@ -600,8 +600,8 @@ ConnectAttempt::processResponse()
JLOG(journal_.info()) << "Cluster name: " << *member;
}
auto const result =
overlay_.peerFinder().activate(slot_, publicKey, !member->empty());
auto const result = overlay_.peerFinder().activate(
slot_, publicKey, member.has_value());
if (result != PeerFinder::Result::success)
{
std::stringstream ss;