Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Unified Diff: third_party/WebKit/Source/modules/presentation/Presentation.cpp

Issue 2502633005: [Presentation API] check if frame() is null before accessing presentation.receiver attr (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/presentation/Presentation.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/Presentation.cpp b/third_party/WebKit/Source/modules/presentation/Presentation.cpp
index 6d38d46fd71a7daf4d619eb8b04f2cb361d8330f..aa15f73e031d3796661a692a3ff9141cf974984c 100644
--- a/third_party/WebKit/Source/modules/presentation/Presentation.cpp
+++ b/third_party/WebKit/Source/modules/presentation/Presentation.cpp
@@ -48,13 +48,16 @@ void Presentation::setDefaultRequest(PresentationRequest* request) {
}
PresentationReceiver* Presentation::receiver() {
- PresentationController* controller = PresentationController::from(*frame());
- auto* client = controller ? controller->client() : nullptr;
+ if (!frame())
+ return nullptr;
// TODO(crbug.com/647296): only return something if the Blink instance is
// running in presentation receiver mode. The flag PresentationReceiver could
// be used for that.
- if (!m_receiver)
+ if (!m_receiver) {
+ PresentationController* controller = PresentationController::from(*frame());
+ auto* client = controller ? controller->client() : nullptr;
m_receiver = new PresentationReceiver(frame(), client);
+ }
return m_receiver;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698