Skip to content

Commit 1267bd5

Browse files
author
Ingo Schwarz
committed
Fix sorting not possible
1 parent 265b839 commit 1267bd5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tableview/src/main/java/de/codecrafters/tableview/SortableTableView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private class SortingController implements TableHeaderClickListener {
190190

191191
@Override
192192
public void onHeaderClicked(final int columnIndex) {
193-
if (comparators.get(columnIndex) != null) {
193+
if (comparators.get(columnIndex) == null) {
194194
Log.i(LOG_TAG, "Unable to sort column with index " + columnIndex + ". Reason: no comparator set for this column.");
195195
return;
196196
}
@@ -203,7 +203,7 @@ public void onHeaderClicked(final int columnIndex) {
203203
}
204204

205205
public void sort(final int columnIndex, final boolean sortUp) {
206-
if (comparators.get(columnIndex) != null) {
206+
if (comparators.get(columnIndex) == null) {
207207
Log.i(LOG_TAG, "Unable to sort column with index " + columnIndex + ". Reason: no comparator set for this column.");
208208
return;
209209
}

0 commit comments

Comments
 (0)