Address error IDE0270 after MsBuild update (#1865)

This commit is contained in:
Cheena Malhotra
2023-02-16 16:15:30 -08:00
committed by GitHub
parent 0f82062502
commit 74dd15c868
14 changed files with 27 additions and 106 deletions

View File

@@ -1,4 +1,4 @@
//
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

View File

@@ -118,14 +118,10 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
}
ObjectExplorerService service = ServiceProvider.GetService<ObjectExplorerService>();
if (service == null)
{
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture,
SqlTools.Hosting.SR.ServiceNotFound, nameof(ObjectExplorerService)));
}
return service;
return ServiceProvider.GetService<ObjectExplorerService>()
?? throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture,
SqlTools.Hosting.SR.ServiceNotFound, nameof(ObjectExplorerService)));
}
/// <summary>