save: Restore the screen before overwriteFile() is left (#2967)

...otherwise there is no screen anymore to draw a possible error message.
This commit is contained in:
Jöran Karl 2023-10-16 10:44:35 +02:00 committed by GitHub
parent db6d4f5461
commit db5fcf11a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,10 +79,10 @@ func overwriteFile(name string, enc encoding.Encoding, fn func(io.Writer) error,
if withSudo {
// wait for dd to finish and restart the screen if we used sudo
err := cmd.Wait()
screen.TempStart(screenb)
if err != nil {
return err
}
screen.TempStart(screenb)
}
return