Always try closing manual input reader

Approved-by: Alan Noble
This commit is contained in:
Saxon Milton 2024-04-07 11:46:27 +00:00
parent 66a1687316
commit d4af5c0194
1 changed files with 2 additions and 6 deletions

View File

@ -118,12 +118,8 @@ func (m *ManualInput) Start() error {
// Stop closes the pipe and sets the isRunning flag to false.
func (m *ManualInput) Stop() error {
if !m.isRunning {
return nil
}
err := m.reader.Close()
if err != nil {
return err
if m.reader != nil {
m.reader.Close()
}
m.isRunning = false
return nil