Commit fdd23be0 authored by Lei Tian's avatar Lei Tian Committed by Commit Bot

Fix tel number parsing crash

UrlUtilities.getTelNumber crash if the url param does not contain ":",
add a check to the function preventing from crash.

Bug: 830086
Change-Id: Icb82df469986f329a5fdaf6ce3b20624a0530acb
Reviewed-on: https://chromium-review.googlesource.com/1091885
Commit-Queue: Lei Tian <ltian@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565456}
parent 65493578
...@@ -65,6 +65,7 @@ public class UrlUtilities { ...@@ -65,6 +65,7 @@ public class UrlUtilities {
* guaranteed. * guaranteed.
*/ */
public static String getTelNumber(String uri) { public static String getTelNumber(String uri) {
if (uri == null || !uri.contains(":")) return "";
return uri.split(":")[1]; return uri.split(":")[1];
} }
......
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