Skip to content

Commit 9145c74

Browse files
committed
refactor: use safe type assertion in handleDelete Range closure
1 parent ec89ae0 commit 9145c74

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • internal/pkg/service/appsproxy/dataapps/k8sapp

internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ func (w *StateWatcher) handleDelete(ctx context.Context, obj any) {
220220
k8sName := u.GetName()
221221

222222
w.apps.Range(func(key, val any) bool {
223-
if val.(entry).k8sName == k8sName {
223+
e, ok := val.(entry)
224+
if ok && e.k8sName == k8sName {
224225
w.apps.Delete(key)
225226
w.logger.Debugf(ctx, "App CRD %q (appID=%s) removed from cache", k8sName, key)
226227
return false

0 commit comments

Comments
 (0)