From 28708fa5e37c3f3f99346dd482f96903396203e5 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Tue, 18 Oct 2016 18:07:32 -0700 Subject: [PATCH] Return null on GET 404 --- .../batch/implementation/BatchAccountsImpl.java | 3 +++ .../compute/implementation/AvailabilitySetsImpl.java | 3 +++ .../VirtualMachineExtensionImageTypesImpl.java | 3 +++ .../VirtualMachineExtensionImageVersionsImpl.java | 3 +++ .../compute/implementation/VirtualMachineOffersImpl.java | 3 +++ .../implementation/VirtualMachinePublishersImpl.java | 3 +++ .../implementation/VirtualMachineScaleSetsImpl.java | 3 +++ .../compute/implementation/VirtualMachineSizesImpl.java | 3 +++ .../compute/implementation/VirtualMachineSkusImpl.java | 3 +++ .../compute/implementation/VirtualMachinesImpl.java | 3 +++ .../graphrbac/implementation/ServicePrincipalsImpl.java | 3 +++ .../management/graphrbac/implementation/UsersImpl.java | 3 +++ .../management/keyvault/implementation/VaultsImpl.java | 3 +++ .../network/implementation/LoadBalancersImpl.java | 3 +++ .../network/implementation/NetworkInterfacesImpl.java | 3 +++ .../network/implementation/NetworkSecurityGroupsImpl.java | 3 +++ .../management/network/implementation/NetworksImpl.java | 3 +++ .../network/implementation/PublicIpAddressesImpl.java | 3 +++ .../management/redis/implementation/RedisCachesImpl.java | 3 +++ .../resources/fluentcore/utils/PagedListConverter.java | 8 ++++++++ .../implementation/DeploymentOperationsImpl.java | 3 +++ .../management/resources/implementation/FeaturesImpl.java | 3 +++ .../resources/implementation/GenericResourcesImpl.java | 6 ++++-- .../resources/implementation/ProvidersImpl.java | 3 +++ .../resources/implementation/ResourceGroupsImpl.java | 3 +++ .../resources/implementation/SubscriptionsImpl.java | 3 +++ .../storage/implementation/StorageAccountsImpl.java | 3 +++ .../management/storage/implementation/UsagesImpl.java | 3 +++ .../website/implementation/AppServicePlansImpl.java | 3 +++ .../website/implementation/CertificateOrdersImpl.java | 3 +++ .../website/implementation/CertificatesImpl.java | 3 +++ .../management/website/implementation/WebAppsImpl.java | 3 +++ 32 files changed, 102 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java index 2cc81f659573c..f893e32b3b3db 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java @@ -66,6 +66,9 @@ public PagedList listByGroup(String resourceGroupName) { @Override protected BatchAccountImpl wrapModel(BatchAccountInner inner) { + if (inner == null) { + return null; + } return new BatchAccountImpl( inner.name(), inner, diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java index f592173d1ba07..e0bb13afd8659 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java @@ -79,6 +79,9 @@ protected AvailabilitySetImpl wrapModel(String name) { @Override protected AvailabilitySetImpl wrapModel(AvailabilitySetInner availabilitySetInner) { + if (availabilitySetInner == null) { + return null; + } return new AvailabilitySetImpl(availabilitySetInner.name(), availabilitySetInner, this.innerCollection, diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageTypesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageTypesImpl.java index 39e9aa7e32a7a..391eb3b441673 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageTypesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageTypesImpl.java @@ -27,6 +27,9 @@ public PagedList list() { @Override protected VirtualMachineExtensionImageTypeImpl wrapModel(VirtualMachineExtensionImageInner inner) { + if (inner == null) { + return null; + } return new VirtualMachineExtensionImageTypeImpl(this.client, this.publisher, inner); } } \ No newline at end of file diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java index e8146c46de18b..58f9fdd80f2f1 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java @@ -29,6 +29,9 @@ public PagedList list() { @Override protected VirtualMachineExtensionImageVersionImpl wrapModel(VirtualMachineExtensionImageInner inner) { + if (inner == null) { + return null; + } return new VirtualMachineExtensionImageVersionImpl(this.client, this.type, inner); } } \ No newline at end of file diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineOffersImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineOffersImpl.java index cad423eed55ef..4a95404ed7f17 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineOffersImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineOffersImpl.java @@ -28,6 +28,9 @@ class VirtualMachineOffersImpl @Override protected VirtualMachineOfferImpl wrapModel(VirtualMachineImageResourceInner inner) { + if (inner == null) { + return null; + } return new VirtualMachineOfferImpl(this.publisher, inner.name(), this.innerCollection); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinePublishersImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinePublishersImpl.java index 4c8ec19496775..fd1b094d87c12 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinePublishersImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinePublishersImpl.java @@ -33,6 +33,9 @@ public PagedList listByRegion(Region region) { @Override protected VirtualMachinePublisherImpl wrapModel(VirtualMachineImageResourceInner inner) { + if (inner == null) { + return null; + } return new VirtualMachinePublisherImpl(Region.fromName(inner.location()), inner.name(), this.imagesInnerCollection, diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java index 231c6006c9044..4fd2ea3d90139 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java @@ -133,6 +133,9 @@ protected VirtualMachineScaleSetImpl wrapModel(String name) { @Override protected VirtualMachineScaleSetImpl wrapModel(VirtualMachineScaleSetInner inner) { + if (inner == null) { + return null; + } return new VirtualMachineScaleSetImpl(inner.name(), inner, this.innerCollection, diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesImpl.java index e93eddcc6b3be..7694fc8767e95 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesImpl.java @@ -30,6 +30,9 @@ public PagedList listByRegion(Region region) { @Override protected VirtualMachineSizeImpl wrapModel(VirtualMachineSizeInner inner) { + if (inner == null) { + return null; + } return new VirtualMachineSizeImpl(inner); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSkusImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSkusImpl.java index ad7afdf74dc3d..217adff0dae9f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSkusImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSkusImpl.java @@ -36,6 +36,9 @@ public PagedList list() { @Override protected VirtualMachineSkuImpl wrapModel(VirtualMachineImageResourceInner inner) { + if (inner == null) { + return null; + } return new VirtualMachineSkuImpl(this.offer, inner.name(), innerCollection); } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java index 345348399ede4..d54e63dbe4f03 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java @@ -161,6 +161,9 @@ protected VirtualMachineImpl wrapModel(String name) { @Override protected VirtualMachineImpl wrapModel(VirtualMachineInner virtualMachineInner) { + if (virtualMachineInner == null) { + return null; + } return new VirtualMachineImpl(virtualMachineInner.name(), virtualMachineInner, this.innerCollection, diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/ServicePrincipalsImpl.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/ServicePrincipalsImpl.java index b611fc17d25c0..f018a9e729cf1 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/ServicePrincipalsImpl.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/ServicePrincipalsImpl.java @@ -58,6 +58,9 @@ protected ServicePrincipalImpl wrapModel(String appId) { @Override protected ServicePrincipalImpl wrapModel(ServicePrincipalInner servicePrincipalInner) { + if (servicePrincipalInner == null) { + return null; + } return new ServicePrincipalImpl(servicePrincipalInner, this.innerCollection); } diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/UsersImpl.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/UsersImpl.java index e91867a2fa66f..010be8f737309 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/UsersImpl.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/UsersImpl.java @@ -54,6 +54,9 @@ protected UserImpl wrapModel(String userPrincipalName) { @Override protected UserImpl wrapModel(UserInner userInner) { + if (userInner == null) { + return null; + } return new UserImpl(userInner, this.innerCollection); } diff --git a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java index b5a817d78da20..cbb5b66374fea 100644 --- a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java +++ b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java @@ -84,6 +84,9 @@ protected VaultImpl wrapModel(String name) { @Override protected VaultImpl wrapModel(VaultInner vaultInner) { + if (vaultInner == null) { + return null; + } return new VaultImpl( vaultInner.name(), vaultInner, diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java index adfbe97bca2ab..5a43055892aa2 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java @@ -70,6 +70,9 @@ protected LoadBalancerImpl wrapModel(String name) { @Override protected LoadBalancerImpl wrapModel(LoadBalancerInner inner) { + if (inner == null) { + return null; + } return new LoadBalancerImpl( inner.name(), inner, diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java index 0b0070de4c400..2fcc8bd564b2c 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java @@ -67,6 +67,9 @@ protected NetworkInterfaceImpl wrapModel(String name) { @Override protected NetworkInterfaceImpl wrapModel(NetworkInterfaceInner inner) { + if (inner == null) { + return null; + } return new NetworkInterfaceImpl(inner.name(), inner, this.innerCollection, diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java index 3da213b95e669..5731eee4d49fb 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java @@ -70,6 +70,9 @@ protected NetworkSecurityGroupImpl wrapModel(String name) { @Override protected NetworkSecurityGroupImpl wrapModel(NetworkSecurityGroupInner inner) { + if (inner == null) { + return null; + } return new NetworkSecurityGroupImpl( inner.name(), inner, diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java index 49cdead98b2be..555507c8e4a3a 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java @@ -102,6 +102,9 @@ protected NetworkImpl wrapModel(String name) { @Override protected NetworkImpl wrapModel(VirtualNetworkInner inner) { + if (inner == null) { + return null; + } return new NetworkImpl( inner.name(), inner, diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java index 87d3522caf72a..abbb4429b0b87 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java @@ -76,6 +76,9 @@ protected PublicIpAddressImpl wrapModel(String name) { @Override protected PublicIpAddressImpl wrapModel(PublicIPAddressInner inner) { + if (inner == null) { + return null; + } return new PublicIpAddressImpl( inner.id(), inner, diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java index f8721429826de..373fc5e07f89d 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java @@ -73,6 +73,9 @@ protected RedisCacheImpl wrapModel(String name) { @Override protected RedisCacheImpl wrapModel(RedisResourceInner redisResourceInner) { + if (redisResourceInner == null) { + return null; + } return new RedisCacheImpl( redisResourceInner.name(), redisResourceInner, diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/utils/PagedListConverter.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/utils/PagedListConverter.java index 8e84d87007c03..2e4d850862ec5 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/utils/PagedListConverter.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/utils/PagedListConverter.java @@ -40,6 +40,14 @@ public abstract class PagedListConverter { * @return the converted list */ public PagedList convert(final PagedList uList) { + if (uList == null || uList.isEmpty()) { + return new PagedList() { + @Override + public Page nextPage(String s) throws RestException, IOException { + return null; + } + }; + } Page uPage = uList.currentPage(); PageImpl vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.getNextPageLink()); diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsImpl.java index 44cede39c6c68..86af22b5a51b7 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsImpl.java @@ -39,6 +39,9 @@ public DeploymentOperation getById(String operationId) { @Override protected DeploymentOperationImpl wrapModel(DeploymentOperationInner inner) { + if (inner == null) { + return null; + } return new DeploymentOperationImpl(inner, this.client); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesImpl.java index c73b050167156..f16a565d198c9 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesImpl.java @@ -35,6 +35,9 @@ public Feature register(String resourceProviderName, String featureName) { @Override protected FeatureImpl wrapModel(FeatureResultInner inner) { + if (inner == null) { + return null; + } return new FeatureImpl(inner); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java index 115c63fc4d00e..7eb6e60057750 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java @@ -6,7 +6,6 @@ package com.microsoft.azure.management.resources.implementation; -import com.microsoft.azure.CloudException; import com.microsoft.azure.PagedList; import com.microsoft.azure.management.resources.GenericResource; import com.microsoft.azure.management.resources.GenericResources; @@ -86,7 +85,7 @@ public GenericResource get( return resource; } } - throw new CloudException("Generic resource not found."); + return null; } @Override @@ -153,6 +152,9 @@ protected GenericResourceImpl wrapModel(String id) { @Override protected GenericResourceImpl wrapModel(GenericResourceInner inner) { + if (inner == null) { + return null; + } return new GenericResourceImpl( inner.id(), inner, diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersImpl.java index 9c637ea502dd1..1d014c43902bb 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersImpl.java @@ -45,6 +45,9 @@ public Provider getByName(String resourceProviderNamespace) { @Override protected ProviderImpl wrapModel(ProviderInner inner) { + if (inner == null) { + return null; + } return new ProviderImpl(inner); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java index 5f0703eb1c285..32b77757a81df 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java @@ -65,6 +65,9 @@ protected ResourceGroupImpl wrapModel(String name) { @Override protected ResourceGroupImpl wrapModel(ResourceGroupInner inner) { + if (inner == null) { + return null; + } return new ResourceGroupImpl(inner, serviceClient); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsImpl.java index 0ebea48117e2f..b24732bda53f5 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsImpl.java @@ -37,6 +37,9 @@ public Subscription typeConvert(SubscriptionInner subscriptionInner) { // Gets a specific resource group public SubscriptionImpl getByName(String name) { SubscriptionInner subscription = client.get(name); + if (subscription == null) { + return null; + } return new SubscriptionImpl(subscription, client); } } diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java index 5220bd477e4b8..0fe0e41f30922 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java @@ -75,6 +75,9 @@ protected StorageAccountImpl wrapModel(String name) { @Override protected StorageAccountImpl wrapModel(StorageAccountInner storageAccountInner) { + if (storageAccountInner == null) { + return null; + } return new StorageAccountImpl( storageAccountInner.name(), storageAccountInner, diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesImpl.java index 9b9e27843c6ee..7e89c215e4d3a 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesImpl.java @@ -23,6 +23,9 @@ public PagedList list() { @Override protected UsageImpl wrapModel(UsageInner usageInner) { + if (usageInner == null) { + return null; + } return new UsageImpl(usageInner); } } diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java index 3cf5c70b12582..3d0f053d2a63b 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/AppServicePlansImpl.java @@ -57,6 +57,9 @@ protected AppServicePlanImpl wrapModel(String name) { @Override protected AppServicePlanImpl wrapModel(AppServicePlanInner inner) { + if (inner == null) { + return null; + } return new AppServicePlanImpl(inner.name(), inner, innerCollection, myManager); } diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java index f3b59d15ab823..dd1297bbd5cf6 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersImpl.java @@ -58,6 +58,9 @@ protected CertificateOrderImpl wrapModel(String name) { @Override protected CertificateOrderImpl wrapModel(AppServiceCertificateOrderInner inner) { + if (inner == null) { + return null; + } return new CertificateOrderImpl(inner.name(), inner, innerCollection, myManager); } diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java index 5c6f282db6784..46a3c37249aa0 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesImpl.java @@ -47,6 +47,9 @@ protected CertificateImpl wrapModel(String name) { @Override protected CertificateImpl wrapModel(CertificateInner inner) { + if (inner == null) { + return null; + } return new CertificateImpl(inner.name(), inner, innerCollection, myManager); } diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java index 0656ad6b1d31a..bdb5575d59064 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/WebAppsImpl.java @@ -46,6 +46,9 @@ protected WebAppImpl wrapModel(String name) { @Override protected WebAppImpl wrapModel(SiteInner inner) { + if (inner == null) { + return null; + } return new WebAppImpl(inner.name(), inner, innerCollection, super.myManager); }