check nil

This commit is contained in:
tanshanshan
2016-12-14 09:18:12 +08:00
parent 234c435827
commit 7d4b594c64
8 changed files with 24 additions and 0 deletions

View File

@@ -58,6 +58,9 @@ func (c *Clientset) Apiregistration() v1alpha1apiregistration.ApiregistrationV1a
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
return nil
}
return c.DiscoveryClient
}

View File

@@ -47,6 +47,9 @@ func (c *Clientset) Apiregistration() internalversionapiregistration.Apiregistra
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
return nil
}
return c.DiscoveryClient
}