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

Unified Diff: base/android/content_uri_utils.cc

Issue 1828193002: DCHECK that jstring to C++ string conversions don't pass in null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: braces Created 4 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 | « android_webview/java/src/org/chromium/android_webview/AwContents.java ('k') | base/android/jni_string.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/content_uri_utils.cc
diff --git a/base/android/content_uri_utils.cc b/base/android/content_uri_utils.cc
index 195598bfb3fd29dd03137bab7478aba8d750ed2c..31f7b4fffbf050f1500618bf7145a5285a09d45e 100644
--- a/base/android/content_uri_utils.cc
+++ b/base/android/content_uri_utils.cc
@@ -43,6 +43,9 @@ std::string GetContentUriMimeType(const FilePath& content_uri) {
ScopedJavaLocalRef<jstring> j_mime =
Java_ContentUriUtils_getMimeType(
env, base::android::GetApplicationContext(), j_uri.obj());
+ if (j_mime.is_null())
+ return std::string();
+
return base::android::ConvertJavaStringToUTF8(env, j_mime.obj());
}
« no previous file with comments | « android_webview/java/src/org/chromium/android_webview/AwContents.java ('k') | base/android/jni_string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698