check for nil cmd
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
2d1e6db9fd
commit
d59db9df16
@ -43,6 +43,7 @@ func (s *service) Init(opts ...Option) {
|
||||
}
|
||||
|
||||
s.once.Do(func() {
|
||||
if s.opts.Cmd != nil {
|
||||
// set cmd name
|
||||
if len(s.opts.Cmd.App().Name) == 0 {
|
||||
s.opts.Cmd.App().Name = s.Server().Options().Name
|
||||
@ -63,6 +64,7 @@ func (s *service) Init(opts ...Option) {
|
||||
); err != nil {
|
||||
logger.Fatalf("[cmd] init failed: %v", err)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if s.opts.Registry != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user