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

Unified Diff: Source/modules/serviceworkers/ServiceWorker.cpp

Issue 323523002: ServiceWorker::from can handle null ServiceWorkers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: null test. Created 6 years, 6 months 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: Source/modules/serviceworkers/ServiceWorker.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorker.cpp b/Source/modules/serviceworkers/ServiceWorker.cpp
index 43c7506c95214bb9082f545862becb68f13e4aa3..b1de87b41bdaa829ed13beb2cea9383ad9f28c18 100644
--- a/Source/modules/serviceworkers/ServiceWorker.cpp
+++ b/Source/modules/serviceworkers/ServiceWorker.cpp
@@ -140,6 +140,9 @@ const AtomicString& ServiceWorker::state() const
PassRefPtr<ServiceWorker> ServiceWorker::from(ExecutionContext* executionContext, WebType* worker)
{
+ if (!worker)
+ return PassRefPtr<ServiceWorker>();
+
blink::WebServiceWorkerProxy* proxy = worker->proxy();
ServiceWorker* existingServiceWorker = proxy ? proxy->unwrap() : 0;
if (existingServiceWorker) {
« 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