From e3e4ae5d2ee4bbd8ba5339f6cb6ae89307173d3c Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 6 Aug 2019 00:24:22 -0700 Subject: [PATCH] Do not panic if the type is not api.Status (an error scenario). Closes #2105 (#2106) --- server/application/application.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/application/application.go b/server/application/application.go index cda182a778..df692e5511 100644 --- a/server/application/application.go +++ b/server/application/application.go @@ -518,8 +518,12 @@ func (s *Server) Watch(q *application.ApplicationQuery, ws application.Applicati done := make(chan bool) go func() { for next := range w.ResultChan() { - a := *next.Object.(*appv1.Application) - _ = sendIfPermitted(a, next.Type) + a, ok := next.Object.(*appv1.Application) + if ok { + _ = sendIfPermitted(*a, next.Type) + } else { + break + } } logCtx.Info("k8s application watch event channel closed") close(done)