Commit 4eff6f7a authored by Alex Chau's avatar Alex Chau Committed by Commit Bot

Add null check before length() call in SharedClipboardShareActivity

Bug: 1074512
Change-Id: Ic7d1436b78fb5786cb451a33e4c7d0448fd13721
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167761
Commit-Queue: Alex Chau <alexchau@chromium.org>
Reviewed-by: default avatarMichael van Ouwerkerk <mvanouwerkerk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763340}
parent 31b34acf
......@@ -15,6 +15,7 @@ import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import org.chromium.base.ContextUtils;
import org.chromium.base.IntentUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.task.PostTask;
import org.chromium.base.task.TaskTraits;
......@@ -124,11 +125,11 @@ public class SharedClipboardShareActivity
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
DeviceInfo device = mAdapter.getItem(position);
String text = getIntent().getStringExtra(Intent.EXTRA_TEXT);
String text = IntentUtils.safeGetStringExtra(getIntent(), Intent.EXTRA_TEXT);
// Log metrics for device click and text size.
SharedClipboardMetrics.recordDeviceClick(position);
SharedClipboardMetrics.recordTextSize(text.length());
SharedClipboardMetrics.recordTextSize(text != null ? text.length() : 0);
SharedClipboardMessageHandler.showSendingNotification(
device.guid, device.clientName, text, /*retries=*/0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment