зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1621779 - Make sure BrowsingContext exists before using it. r=alwu
A declare of a pointer in the init-statement within if need to be checked if it's a NULL before it's being used, to avoid a potential crash. To prevent any goes wrong in mMediaSessionInfoMap and lead to create a null BrowsingContext pointer from it, using an assertion is more straightforward. Differential Revision: https://phabricator.services.mozilla.com/D66491 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b95018d119
Коммит
ce0d9c74e7
|
@ -105,8 +105,9 @@ void MediaSessionController::UpdateActiveMediaSessionContextId() {
|
|||
|
||||
for (auto iter = mMediaSessionInfoMap.ConstIter(); !iter.Done();
|
||||
iter.Next()) {
|
||||
if (RefPtr<BrowsingContext> bc = BrowsingContext::Get(iter.Key());
|
||||
bc->IsTopContent()) {
|
||||
RefPtr<BrowsingContext> bc = BrowsingContext::Get(iter.Key());
|
||||
MOZ_ASSERT(bc);
|
||||
if (bc->IsTopContent()) {
|
||||
candidateId = iter.Key();
|
||||
break;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче