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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

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 | « no previous file | base/android/content_uri_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 046ccfccecb9e2b2281b33dc4b7e558345fc8cc6..4ddd359936de48507a4df36bdc2e179d2fc8d115 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -1347,6 +1347,14 @@ public class AwContents implements SmartClipProvider,
ValueCallback<String[]> callback = new ValueCallback<String[]>() {
@Override
public void onReceiveValue(final String[] value) {
+ if (value != null) {
+ // Replace null values with empty strings, because they can't be represented as
+ // native strings.
+ for (int i = 0; i < value.length; i++) {
+ if (value[i] == null) value[i] = "";
+ }
+ }
+
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
« no previous file with comments | « no previous file | base/android/content_uri_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698