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

Unified Diff: third_party/WebKit/Source/modules/webdatabase/Database.cpp

Issue 2375733003: Add missing null check in Database::getSecurityOrigin() (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash-expected.txt ('k') | 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/webdatabase/Database.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/Database.cpp b/third_party/WebKit/Source/modules/webdatabase/Database.cpp
index 3f3b630df32067a79dd643ac02a1637db06e425f..717616678e8afad4c1b992fda9a3d369530ecd1a 100644
--- a/third_party/WebKit/Source/modules/webdatabase/Database.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/Database.cpp
@@ -897,11 +897,13 @@ Vector<String> Database::tableNames()
SecurityOrigin* Database::getSecurityOrigin() const
{
+ if (!getExecutionContext())
+ return nullptr;
if (getExecutionContext()->isContextThread())
return m_contextThreadSecurityOrigin.get();
if (getDatabaseContext()->databaseThread()->isDatabaseThread())
return m_databaseThreadSecurityOrigin.get();
- return 0;
+ return nullptr;
}
bool Database::opened()
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698