Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tmc): panic due to index out of range in logsyncer (#1189)
## Reasons For This Change When providing an stdout/stderr containing an empty line, the log syncer crashes: ``` panic: runtime error: index out of range [-1] goroutine 213 [running]: github.com/terramate-io/terramate/cloud.dropCRLN(...) /vagrant/terramate/cloud/log_syncer.go:192 github.com/terramate-io/terramate/cloud.(*LogSyncer).NewBuffer.func1() /vagrant/terramate/cloud/log_syncer.go:103 +0x6fd created by github.com/terramate-io/terramate/cloud.(*LogSyncer).NewBuffer /vagrant/terramate/cloud/log_syncer.go:80 +0x2a5 FAIL github.com/terramate-io/terramate/cloud 0.055s FAIL ``` ### Description of Changes A bounds check is added before removing the CRLN from the line.
- Loading branch information