diff --git a/java/Chapter 1/Question1_1/Question.java b/java/Chapter 1/Question1_1/Question.java index 5c5b38e8..9590ec28 100644 --- a/java/Chapter 1/Question1_1/Question.java +++ b/java/Chapter 1/Question1_1/Question.java @@ -3,6 +3,9 @@ public class Question { public static boolean isUniqueChars(String str) { + if (null==str) { + return false; + } if (str.length() > 128) { return false; } @@ -16,6 +19,9 @@ public static boolean isUniqueChars(String str) { } public static boolean isUniqueChars2(String str) { + if (null==str) { + return false; + } if (str.length() > 128) { return false; }