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

Unified Diff: Source/modules/quota/StorageQuota.cpp

Issue 212123005: Quota: Add null check (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « Source/modules/quota/DeprecatedStorageQuota.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/quota/StorageQuota.cpp
diff --git a/Source/modules/quota/StorageQuota.cpp b/Source/modules/quota/StorageQuota.cpp
index 44226c7b28dabdc9795b61b160f64d07707076f3..5c07bf3b69608128d4021882382f31348230f496 100644
--- a/Source/modules/quota/StorageQuota.cpp
+++ b/Source/modules/quota/StorageQuota.cpp
@@ -106,7 +106,14 @@ ScriptPromise StorageQuota::requestPersistentQuota(ExecutionContext* executionCo
{
ASSERT(executionContext);
- return StorageQuotaClient::from(executionContext)->requestPersistentQuota(executionContext, newQuota);
+ StorageQuotaClient* client = StorageQuotaClient::from(executionContext);
+ if (!client) {
+ RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(executionContext);
+ resolver->reject(DOMError::create(NotSupportedError));
+ return resolver->promise();
+ }
+
+ return client->requestPersistentQuota(executionContext, newQuota);
}
StorageQuota::~StorageQuota()
« no previous file with comments | « Source/modules/quota/DeprecatedStorageQuota.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698