mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
termstatus: fix crash when printing empty string
This commit is contained in:
@@ -237,7 +237,7 @@ func (t *Terminal) runWithoutStatus(ctx context.Context) {
|
||||
|
||||
func (t *Terminal) print(line string, isErr bool) {
|
||||
// make sure the line ends with a line break
|
||||
if line[len(line)-1] != '\n' {
|
||||
if len(line) == 0 || line[len(line)-1] != '\n' {
|
||||
line += "\n"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user