Skip to content

Commit 2b3238d

Browse files
author
Shawn Hurley
committed
Dealing with nil Type
1 parent ec674d6 commit 2b3238d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/source/source.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ func (ks *Kind) Start(handler handler.EventHandler, queue workqueue.RateLimiting
9696
}
9797

9898
func (ks *Kind) String() string {
99-
return fmt.Sprintf("kind source: %v", ks.Type.GetObjectKind().GroupVersionKind().String())
99+
if ks.Type != nil && ks.Type.GetObjectKind() != nil {
100+
return fmt.Sprintf("kind source: %v", ks.Type.GetObjectKind().GroupVersionKind().String())
101+
}
102+
return fmt.Sprintf("kind source: unknown GVK")
100103
}
101104

102105
var _ inject.Cache = &Kind{}

0 commit comments

Comments
 (0)