mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 17:56:45 +08:00
fix panic when config value set 0 (#1723)
This commit is contained in:
@ -123,6 +123,9 @@ func configureSet(t *Term, args string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return reflect.ValueOf(nil), fmt.Errorf("argument to %q must be a number", cfgname)
|
return reflect.ValueOf(nil), fmt.Errorf("argument to %q must be a number", cfgname)
|
||||||
}
|
}
|
||||||
|
if n < 0 {
|
||||||
|
return reflect.ValueOf(nil), fmt.Errorf("argument to %q must be a number greater than zero", cfgname)
|
||||||
|
}
|
||||||
return reflect.ValueOf(&n), nil
|
return reflect.ValueOf(&n), nil
|
||||||
case reflect.Bool:
|
case reflect.Bool:
|
||||||
v := rest == "true"
|
v := rest == "true"
|
||||||
|
|||||||
Reference in New Issue
Block a user