mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
fix invalid height error
This commit is contained in:
@@ -1882,10 +1882,10 @@ func LineSetHeightCommand(ctx context.Context, pk *scpacket.FeCommandPacketType)
|
||||
return nil, fmt.Errorf("error looking up lineid: %v", err)
|
||||
}
|
||||
heightVal, err := resolveNonNegInt(pk.Args[1], 0)
|
||||
if heightVal == 0 {
|
||||
return nil, fmt.Errorf("/line:setheight invalid height val")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("/line:setheight invalid height val: %v", err)
|
||||
}
|
||||
if heightVal > 10000 {
|
||||
if heightVal > 1000 {
|
||||
return nil, fmt.Errorf("/line:setheight invalid height val (too large): %d", heightVal)
|
||||
}
|
||||
err = sstore.UpdateLineHeight(ctx, lineId, heightVal)
|
||||
|
||||
Reference in New Issue
Block a user