fix SIGSEGV on Enable Watch

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2025-06-06 09:57:19 +02:00 committed by Guillaume Lours
parent 9b67a48c33
commit 7b9ad96240

View File

@ -72,13 +72,10 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
var isTerminated atomic.Bool var isTerminated atomic.Bool
printer := newLogPrinter(options.Start.Attach) printer := newLogPrinter(options.Start.Attach)
var watcher *Watcher watcher, err := NewWatcher(project, options, s.watch)
if options.Start.Watch { if err != nil && options.Start.Watch {
watcher, err = NewWatcher(project, options, s.watch)
if err != nil {
return err return err
} }
}
var navigationMenu *formatter.LogKeyboard var navigationMenu *formatter.LogKeyboard
var kEvents <-chan keyboard.KeyEvent var kEvents <-chan keyboard.KeyEvent