Fix panic conditions
This commit is contained in:
parent
9f985ae044
commit
5d1d3cc9e6
|
@ -125,7 +125,10 @@ func (h *Handler) listenForServerEvents(ctx context.Context) error {
|
|||
}
|
||||
onError(server.InstallOutputEvent, sendErr)
|
||||
case b := <-eventChan:
|
||||
e := events.MustDecode(b)
|
||||
var e events.Event
|
||||
if err := events.DecodeTo(b, &e); err != nil {
|
||||
continue
|
||||
}
|
||||
var sendErr error
|
||||
message := Message{Event: e.Topic}
|
||||
if str, ok := e.Data.(string); ok {
|
||||
|
|
|
@ -93,7 +93,10 @@ func (s *Server) StartEventListeners() {
|
|||
select {
|
||||
case v := <-c:
|
||||
go func(v []byte, limit *diskSpaceLimiter) {
|
||||
e := events.MustDecode(v)
|
||||
var e events.Event
|
||||
if err := events.DecodeTo(v, &e); err != nil {
|
||||
return
|
||||
}
|
||||
switch e.Topic {
|
||||
case environment.ResourceEvent:
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user