Skip to content

Commit a43165c

Browse files
authored
feat: 原始数据查询异常问题修复 --story=128577548 (#1109)
1 parent 00a14c5 commit a43165c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pkg/unify-query/internal/query/orders.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ func SortSliceListWithTime(list []map[string]any, os metadata.Orders, fieldType
3131
a := list[i][o.Name]
3232
b := list[j][o.Name]
3333

34+
// 添加nil安全检查,考虑o.Ast排序方向
35+
if a == nil && b == nil {
36+
continue
37+
}
38+
if a == nil {
39+
// 升序时nil排在后面(false),降序时nil排在前面(true)
40+
return !o.Ast
41+
}
42+
if b == nil {
43+
// 升序时nil排在后面(true),降序时nil排在前面(false)
44+
return o.Ast
45+
}
46+
3447
if a == b {
3548
continue
3649
}

0 commit comments

Comments
 (0)