diff --git a/dom/media/eme/CDMProxy.cpp b/dom/media/eme/CDMProxy.cpp index 3174347bd1f8..278dc92cda07 100644 --- a/dom/media/eme/CDMProxy.cpp +++ b/dom/media/eme/CDMProxy.cpp @@ -396,7 +396,9 @@ CDMProxy::OnSetSessionId(uint32_t aCreateSessionToken, } nsRefPtr session(mKeys->GetPendingSession(aCreateSessionToken)); - session->SetSessionId(aSessionId); + if (session) { + session->SetSessionId(aSessionId); + } } void diff --git a/dom/media/eme/MediaKeySession.cpp b/dom/media/eme/MediaKeySession.cpp index 87de878e2eb9..5fd9e98d0d9b 100644 --- a/dom/media/eme/MediaKeySession.cpp +++ b/dom/media/eme/MediaKeySession.cpp @@ -66,7 +66,7 @@ MediaKeySession::MediaKeySession(JSContext* aCx, void MediaKeySession::SetSessionId(const nsAString& aSessionId) { EME_LOG("MediaKeySession[%p,'%s'] session Id set", - this, NS_ConvertUTF16toUTF8(mSessionId).get()); + this, NS_ConvertUTF16toUTF8(aSessionId).get()); if (NS_WARN_IF(!mSessionId.IsEmpty())) { return;