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