mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-23 00:48:47 +00:00
Validate not-null ctor args
This commit is contained in:
parent
5b6bbac689
commit
c7709d9b93
@ -30,7 +30,10 @@ public sealed class CommandsExtension : VirtualParadiseClientExtension
|
|||||||
public CommandsExtension(VirtualParadiseClient client, CommandsExtensionConfiguration configuration)
|
public CommandsExtension(VirtualParadiseClient client, CommandsExtensionConfiguration configuration)
|
||||||
: base(client)
|
: base(client)
|
||||||
{
|
{
|
||||||
_configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
|
ArgumentNullException.ThrowIfNull(client);
|
||||||
|
ArgumentNullException.ThrowIfNull(configuration);
|
||||||
|
|
||||||
|
_configuration = configuration;
|
||||||
_configuration.Services ??= client.Services;
|
_configuration.Services ??= client.Services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,10 @@ public sealed partial class VirtualParadiseClient : IDisposable
|
|||||||
/// Initializes a new instance of the <see cref="VirtualParadiseClient" /> class with a specified configuration.
|
/// Initializes a new instance of the <see cref="VirtualParadiseClient" /> class with a specified configuration.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The configuration for this client.</value>
|
/// <value>The configuration for this client.</value>
|
||||||
|
/// <exception cref="ArgumentNullException"><paramref name="configuration" /> is <see langword="null" />.</exception>
|
||||||
public VirtualParadiseClient(VirtualParadiseConfiguration configuration)
|
public VirtualParadiseClient(VirtualParadiseConfiguration configuration)
|
||||||
{
|
{
|
||||||
|
ArgumentNullException.ThrowIfNull(configuration);
|
||||||
Services = configuration.Services;
|
Services = configuration.Services;
|
||||||
_configuration = new VirtualParadiseConfiguration(configuration);
|
_configuration = new VirtualParadiseConfiguration(configuration);
|
||||||
Initialize();
|
Initialize();
|
||||||
|
Loading…
Reference in New Issue
Block a user