Merge pull request #38666 from tanshanshan/empty-check

Automatic merge from submit-queue (batch tested with PRs 39475, 38666, 39327, 38396, 39613)

Add checking the nil value 

**What this PR does / why we need it**:

Add checking the nil value.

Thanks.

**Special notes for your reviewer**:
This commit is contained in:
Kubernetes Submit Queue 2017-01-11 09:14:52 -08:00 committed by GitHub
commit 931bccf907
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
}

View File

@ -149,6 +149,9 @@ func (c *Clientset) $.Group$() $.PackageName$.$.GroupVersion$Interface {
var getDiscoveryTemplate = `
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() $.DiscoveryInterface|raw$ {
if c == nil {
return nil
}
return c.DiscoveryClient
}
`

View File

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

View File

@ -124,6 +124,9 @@ func (c *Clientset) Federation() v1beta1federation.FederationV1beta1Interface {
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
return nil
}
return c.DiscoveryClient
}

View File

@ -83,6 +83,9 @@ func (c *Clientset) Federation() internalversionfederation.FederationInterface {
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
return nil
}
return c.DiscoveryClient
}

View File

@ -290,6 +290,9 @@ func (c *Clientset) Storage() v1beta1storage.StorageV1beta1Interface {
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
return nil
}
return c.DiscoveryClient
}

View File

@ -167,6 +167,9 @@ func (c *Clientset) Storage() internalversionstorage.StorageInterface {
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
return nil
}
return c.DiscoveryClient
}