Commit f5cb28ac authored by François Beaufort's avatar François Beaufort Committed by Commit Bot

[Picture-in-Picture] Fix crash when closing window.

This CL makes sure the active_session_ object exists before shutting
it down. Without this, it was potentially causing a browser crash.

Bug: 1066768
Change-Id: I2793be0862b7c14b957712740c0bbde2b8d9f21a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2131627
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755427}
parent e6b51727
......@@ -314,7 +314,9 @@ void PictureInPictureWindowControllerImpl::OnLeavingPictureInPicture(
}
if (media_player_id_.has_value()) {
active_session_->Shutdown();
if (active_session_)
active_session_->Shutdown();
active_session_ = nullptr;
media_player_id_.reset();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment