mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-22 19:38: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)
|
||||
: base(client)
|
||||
{
|
||||
_configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
|
||||
ArgumentNullException.ThrowIfNull(client);
|
||||
ArgumentNullException.ThrowIfNull(configuration);
|
||||
|
||||
_configuration = configuration;
|
||||
_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.
|
||||
/// </summary>
|
||||
/// <value>The configuration for this client.</value>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="configuration" /> is <see langword="null" />.</exception>
|
||||
public VirtualParadiseClient(VirtualParadiseConfiguration configuration)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(configuration);
|
||||
Services = configuration.Services;
|
||||
_configuration = new VirtualParadiseConfiguration(configuration);
|
||||
Initialize();
|
||||
|
Loading…
Reference in New Issue
Block a user