mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-17 22:19:38 +00:00
fixed nil pointer when closing stream
This commit is contained in:
@@ -171,6 +171,7 @@ func Stream(c *gin.Context) {
|
||||
wg.Done()
|
||||
}()
|
||||
|
||||
wc.Close()
|
||||
wg.Wait()
|
||||
c.String(200, "")
|
||||
|
||||
|
@@ -61,8 +61,9 @@ func (s *stream) Delete(name string) error {
|
||||
if !s.exists(name) {
|
||||
return fmt.Errorf("stream: cannot delete stream %s, not found", name)
|
||||
}
|
||||
w := s.writers[name]
|
||||
delete(s.writers, name)
|
||||
return s.writers[name].Close()
|
||||
return w.Close()
|
||||
}
|
||||
|
||||
func (s *stream) exists(name string) bool {
|
||||
|
Reference in New Issue
Block a user