summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2010-08-11 09:48:43 -0400
committerPatrick Scott <phanna@android.com>2010-08-11 09:48:43 -0400
commit9902196f9885d369e37cf44084e3f04513511ab0 (patch)
tree36b0232c8fbaa850cabdc828a335d816ec4eb317
parent1777a2748bfa25dfd9d081d71504572b9a7256b1 (diff)
downloadframeworks_base-9902196f9885d369e37cf44084e3f04513511ab0.zip
frameworks_base-9902196f9885d369e37cf44084e3f04513511ab0.tar.gz
frameworks_base-9902196f9885d369e37cf44084e3f04513511ab0.tar.bz2
Fix npe in getCacheTotalSize.
Bug: 2882277 Change-Id: I9319a48e0ed75561d3d04691fb288f69d11edc84
-rw-r--r--core/java/android/webkit/WebViewDatabase.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebViewDatabase.java b/core/java/android/webkit/WebViewDatabase.java
index b18419d..7acd9ba 100644
--- a/core/java/android/webkit/WebViewDatabase.java
+++ b/core/java/android/webkit/WebViewDatabase.java
@@ -727,6 +727,9 @@ public class WebViewDatabase {
}
long getCacheTotalSize() {
+ if (mCacheDatabase == null) {
+ return 0;
+ }
long size = 0;
Cursor cursor = null;
final String query = "SELECT SUM(contentlength) as sum FROM cache";