From 66d955ad711d4a1248157056a1d3d643af19fd3f Mon Sep 17 00:00:00 2001 From: Satoshi Kataoka Date: Wed, 3 Oct 2012 17:15:47 +0900 Subject: [PATCH] Throw illegal argument exception in BinaryDictionary::editDistance Bug: 7276803 Change-Id: Icd9bdec0a04179a29d00336819d205627f77b71a --- java/src/com/android/inputmethod/latin/BinaryDictionary.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index e084cb306..7184f1d8a 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -187,6 +187,9 @@ public final class BinaryDictionary extends Dictionary { } public static int editDistance(String before, String after) { + if (before == null || after == null) { + throw new IllegalArgumentException(); + } return editDistanceNative(before.toCharArray(), after.toCharArray()); }