소스 검색

add null check

AndyScherzinger 7 년 전
부모
커밋
e55f0e43b9
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/main/java/third_parties/daveKoeller/AlphanumComparator.java

+ 5 - 0
src/main/java/third_parties/daveKoeller/AlphanumComparator.java

@@ -105,6 +105,11 @@ public class AlphanumComparator<T> implements Comparator<T>, Serializable {
     }
 
     public int compare(String s1, String s2) {
+        if ((s1 == null) || (s2 == null))
+        {
+            return 0;
+        }
+        
         int thisMarker = 0;
         int thatMarker = 0;
         int s1Length = s1.length();