fix: server 包中 RegConsoleCommandEvent 函数空指针问题处理
This commit is contained in:
parent
7c6722e36d
commit
2ed52fc814
|
@ -95,7 +95,12 @@ func (slf *event) RegConsoleCommandEvent(command string, handle ConsoleCommandEv
|
|||
}
|
||||
}()
|
||||
})
|
||||
slf.consoleCommandEventHandles[command].Append(handle, slice.GetValue(priority, 0))
|
||||
list, exist := slf.consoleCommandEventHandles[command]
|
||||
if !exist {
|
||||
list = slice.NewPriority[ConsoleCommandEventHandle]()
|
||||
slf.consoleCommandEventHandles[command] = list
|
||||
}
|
||||
list.Append(handle, slice.GetValue(priority, 0))
|
||||
log.Info("Server", log.String("RegEvent", runtimes.CurrentRunningFuncName()), log.String("handle", reflect.TypeOf(handle).String()))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue