1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-23 00:28:48 +00:00

Validate not-null argument

This commit is contained in:
Oliver Booth 2022-11-29 18:38:00 +00:00
parent 002d53f003
commit bb1fda7f9f
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -12,8 +12,15 @@ namespace VpSharp.Entities;
/// </summary> /// </summary>
public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject> public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject>
{ {
/// <summary>
/// Initializes a new instance of the <see cref="VirtualParadiseObject" /> class.
/// </summary>
/// <param name="client">The owning client.</param>
/// <param name="id">The object ID.</param>
/// <exception cref="ArgumentNullException"><paramref name="client" /> is <see langword="null" />.</exception>
protected internal VirtualParadiseObject(VirtualParadiseClient client, int id) protected internal VirtualParadiseObject(VirtualParadiseClient client, int id)
{ {
ArgumentNullException.ThrowIfNull(client);
Client = client; Client = client;
Id = id; Id = id;
} }
@ -212,6 +219,7 @@ public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject>
protected internal virtual void ExtractFromOther(VirtualParadiseObject virtualParadiseObject) protected internal virtual void ExtractFromOther(VirtualParadiseObject virtualParadiseObject)
{ {
ArgumentNullException.ThrowIfNull(virtualParadiseObject);
Location = virtualParadiseObject.Location; Location = virtualParadiseObject.Location;
Owner = virtualParadiseObject.Owner; Owner = virtualParadiseObject.Owner;
} }