From d4af5c0194f16566c3c9d109da1feca9111fecaa Mon Sep 17 00:00:00 2001 From: Saxon Milton Date: Sun, 7 Apr 2024 11:46:27 +0000 Subject: [PATCH] Always try closing manual input reader Approved-by: Alan Noble --- device/device.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/device/device.go b/device/device.go index b918aba4..f087255b 100644 --- a/device/device.go +++ b/device/device.go @@ -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