Skip to content

Commit b3ea1b4

Browse files
committed
Use ArgumentNullException.ThrowIfNull() instead of explicitly throwing a new Exception instance
1 parent 72e8584 commit b3ea1b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Microsoft.OpenApi.Hidi/Utilities/SettingsUtilities.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4+
using System;
45
using System.IO;
56
using Microsoft.Extensions.Configuration;
67
using Microsoft.OpenApi.OData;
@@ -27,7 +28,7 @@ internal static IConfiguration GetConfiguration(string? settingsFile = null)
2728

2829
internal static OpenApiConvertSettings GetOpenApiConvertSettings(IConfiguration config, string? metadataVersion)
2930
{
30-
if (config == null) { throw new System.ArgumentNullException(nameof(config)); }
31+
ArgumentNullException.ThrowIfNull(config);
3132
var settings = new OpenApiConvertSettings();
3233
if (!string.IsNullOrEmpty(metadataVersion))
3334
settings.SemVerVersion = metadataVersion;

0 commit comments

Comments
 (0)