mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-24 08:02:18 +02:00
fixed nil pointer when closing stream
This commit is contained in:
parent
34c3c92ec3
commit
f8a2a32383
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user