Skip to content

Commit 9e7ddce

Browse files
committed
Handle null values for messages number
1 parent 1e61f99 commit 9e7ddce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/src/main/java/io/kafbat/ui/controller/TopicsController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,10 @@ private Comparator<InternalTopic> getComparatorForTopic(
362362
case OUT_OF_SYNC_REPLICAS -> Comparator.comparing(t -> t.getReplicas() - t.getInSyncReplicas());
363363
case REPLICATION_FACTOR -> Comparator.comparing(InternalTopic::getReplicationFactor);
364364
case SIZE -> Comparator.comparing(InternalTopic::getSegmentSize);
365-
case MESSAGES_NUMBER -> Comparator.comparing(InternalTopic::getMessagesNumber);
365+
case MESSAGES_NUMBER -> Comparator.comparing(
366+
InternalTopic::getMessagesNumber,
367+
Comparator.nullsLast(Long::compareTo)
368+
);
366369
default -> defaultComparator;
367370
};
368371
}

0 commit comments

Comments
 (0)