Browse Source

use null-safe equals

Niklas Seyfarth 6 years ago
parent
commit
7f3091fe20
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/main/java/me/km/table/Table.java

+ 2 - 1
src/main/java/me/km/table/Table.java

@@ -3,6 +3,7 @@ package me.km.table;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Map;
+import java.util.Objects;
 
 
 public class Table 
 public class Table 
 {
 {
@@ -72,7 +73,7 @@ public class Table
         int i = 0;
         int i = 0;
         for(Object[] ob : list)
         for(Object[] ob : list)
         {
         {
-            if(ob[sortColumn].equals(o))
+            if(Objects.equals(ob[sortColumn].equals(o)))
             {
             {
                 return i;
                 return i;
             }
             }