[Fix] Missing null checks in RoleConnectionProperties (#2759)
* add null check * more null checks
This commit is contained in:
@@ -120,13 +120,16 @@ public class RoleConnectionProperties
|
|||||||
{
|
{
|
||||||
PlatformName = platformName;
|
PlatformName = platformName;
|
||||||
PlatformUsername = platformUsername;
|
PlatformUsername = platformUsername;
|
||||||
Metadata = metadata.ToDictionary();
|
Metadata = metadata?.ToDictionary() ?? new ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of <see cref="RoleConnectionProperties"/>.
|
/// Initializes a new instance of <see cref="RoleConnectionProperties"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RoleConnectionProperties() { }
|
public RoleConnectionProperties()
|
||||||
|
{
|
||||||
|
Metadata = new();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new <see cref="RoleConnectionProperties"/> with the data from provided <see cref="RoleConnection"/>.
|
/// Initializes a new <see cref="RoleConnectionProperties"/> with the data from provided <see cref="RoleConnection"/>.
|
||||||
@@ -136,6 +139,6 @@ public class RoleConnectionProperties
|
|||||||
{
|
{
|
||||||
PlatformName = roleConnection.PlatformName,
|
PlatformName = roleConnection.PlatformName,
|
||||||
PlatformUsername = roleConnection.PlatformUsername,
|
PlatformUsername = roleConnection.PlatformUsername,
|
||||||
Metadata = roleConnection.Metadata.ToDictionary()
|
Metadata = roleConnection.Metadata?.ToDictionary()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user