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