Ignore nil values in config loop

Skip nil values in configuration processing
This commit is contained in:
Klimov Sergei 2025-10-31 23:26:38 +08:00 committed by GitHub
parent 243407a3aa
commit 62b27fb6aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,6 +103,9 @@ func (c *ChainConfig) LoadForks(file []byte) error {
epochs["GENESIS"] = 0 epochs["GENESIS"] = 0
for key, value := range config { for key, value := range config {
if value == nil {
continue
}
if strings.HasSuffix(key, "_FORK_VERSION") { if strings.HasSuffix(key, "_FORK_VERSION") {
name := key[:len(key)-len("_FORK_VERSION")] name := key[:len(key)-len("_FORK_VERSION")]
switch version := value.(type) { switch version := value.(type) {