diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/LoadBalanceScanWorkerSelector.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/LoadBalanceScanWorkerSelector.java index 51c6f0567aac072..89931daefe82534 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/LoadBalanceScanWorkerSelector.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/LoadBalanceScanWorkerSelector.java @@ -341,8 +341,11 @@ private long getScanRangeSize(ScanNode scanNode, TScanRangeLocations scanRangeLo if (extScanRange != null) { TFileScanRange fileScanRange = extScanRange.getFileScanRange(); long size = 0; - for (TFileRangeDesc range : fileScanRange.getRanges()) { - size += range.getSize(); + List ranges = fileScanRange.getRanges(); + if (ranges != null) { + for (TFileRangeDesc range : ranges) { + size += range.getSize(); + } } return size; }