diff --git a/src/sip/sdp.cpp b/src/sip/sdp.cpp
index 12ee18f5320eb7bc717036fcf2488b9ba1604285..1b9f3ab7e73baf4a52126d052d3e18ae75c16d04 100644
--- a/src/sip/sdp.cpp
+++ b/src/sip/sdp.cpp
@@ -717,9 +717,9 @@ IceTransport::Attribute
 Sdp::getIceAttributes() const
 {
     IceTransport::Attribute ice_attrs;
-    auto session = activeRemoteSession_ ? activeRemoteSession_ : remoteSession_;
-    assert(session);
-    return getIceAttributes(session);
+    if (auto session = (activeRemoteSession_ ? activeRemoteSession_ : remoteSession_))
+        return getIceAttributes(session);
+    return {};
 }
 
 IceTransport::Attribute