mirror of
https://github.com/restic/restic.git
synced 2026-02-03 04:20:45 -05:00
termstatus: fix crash when printing empty string
This commit is contained in:
parent
e9b6149303
commit
91ecac8003
1 changed files with 1 additions and 1 deletions
|
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue