diff --git a/changelog.md b/changelog.md index 0e9c8162a7..c381c3414b 100644 --- a/changelog.md +++ b/changelog.md @@ -55,6 +55,7 @@ - [#4184](https://github.com/ignite/cli/pull/4184) Set custom `InitChainer` because of manually registered modules - [#4198](https://github.com/ignite/cli/pull/4198) Set correct prefix overwriting in `buf.gen.pulsar.yaml` - [#4199](https://github.com/ignite/cli/pull/4199) Set and seal SDK global config in `app/config.go` +- [#4212](https://github.com/ignite/cli/pull/4212) set default values for extension flag to dont crash ignite ## [`v28.4.0`](https://github.com/ignite/cli/releases/tag/v28.4.0) diff --git a/ignite/services/plugin/grpc/v1/interface_flag.go b/ignite/services/plugin/grpc/v1/interface_flag.go index c3836f0ce4..c4136469f5 100644 --- a/ignite/services/plugin/grpc/v1/interface_flag.go +++ b/ignite/services/plugin/grpc/v1/interface_flag.go @@ -34,6 +34,20 @@ func newDefaultFlagValueError(typeName, value string) error { } func (f *Flag) exportToFlagSet(fs *pflag.FlagSet) error { + switch f.Type { //nolint:exhaustive + case Flag_TYPE_FLAG_BOOL, + Flag_TYPE_FLAG_INT, + Flag_TYPE_FLAG_INT64, + Flag_TYPE_FLAG_UINT, + Flag_TYPE_FLAG_UINT64: + if f.DefaultValue == "" { + f.DefaultValue = "0" + } + if f.Value == "" { + f.Value = "0" + } + } + switch f.Type { case Flag_TYPE_FLAG_BOOL: v, err := strconv.ParseBool(f.DefaultValue)