fix array range panic

test-errcode
wangchuxiao 1 year ago
parent b762650588
commit 3c8ae2370b

@ -483,6 +483,9 @@ func (db *commonMsgDatabase) GetMsgBySeqsRange(ctx context.Context, userID strin
break break
} }
} }
if len(seqs) == 0 {
return 0, 0, nil, nil
}
newBegin := seqs[0] newBegin := seqs[0]
newEnd := seqs[len(seqs)-1] newEnd := seqs[len(seqs)-1]
log.ZDebug(ctx, "GetMsgBySeqsRange", "first seqs", seqs, "newBegin", newBegin, "newEnd", newEnd) log.ZDebug(ctx, "GetMsgBySeqsRange", "first seqs", seqs, "newBegin", newBegin, "newEnd", newEnd)

Loading…
Cancel
Save