From 1ef68d5388427110b735e11ca6ab0c40a1ff9de8 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Mon, 8 Jan 2024 10:29:13 -0500 Subject: [PATCH] Update src/impl/peerconnection.cpp Co-authored-by: Paul-Louis Ageneau --- src/impl/peerconnection.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/impl/peerconnection.cpp b/src/impl/peerconnection.cpp index 3820ce146..7c40de78e 100644 --- a/src/impl/peerconnection.cpp +++ b/src/impl/peerconnection.cpp @@ -424,12 +424,8 @@ void PeerConnection::rollbackLocalDescription() { bool PeerConnection::checkFingerprint(const std::string &fingerprint) const { std::lock_guard lock(mRemoteDescriptionMutex); - std::string expectedFingerprint = "[none]"; - if (mRemoteDescription && mRemoteDescription->fingerprint().has_value()) { - expectedFingerprint = mRemoteDescription->fingerprint().value().value; - } - - if (expectedFingerprint == fingerprint) { + auto expectedFingerprint = mRemoteDescription && mRemoteDescription->fingerprint() ? mRemoteDescription->fingerprint().value : nullopt; + if (expectedFingerprint && *expectedFingerprint == fingerprint) { PLOG_VERBOSE << "Valid fingerprint \"" << fingerprint << "\""; return true; }