[Fix] Missing null checks in RoleConnectionProperties (#2759)

* add null check

* more null checks
This commit is contained in:
Mihail Gribkov
2023-11-18 23:50:55 +03:00
committed by GitHub
parent 5cfec056cb
commit ab3b30dee4

View File

@@ -120,13 +120,16 @@ public class RoleConnectionProperties
{
PlatformName = platformName;
PlatformUsername = platformUsername;
Metadata = metadata.ToDictionary();
Metadata = metadata?.ToDictionary() ?? new ();
}
/// <summary>
/// Initializes a new instance of <see cref="RoleConnectionProperties"/>.
/// </summary>
public RoleConnectionProperties() { }
public RoleConnectionProperties()
{
Metadata = new();
}
/// <summary>
/// Initializes a new <see cref="RoleConnectionProperties"/> with the data from provided <see cref="RoleConnection"/>.
@@ -136,6 +139,6 @@ public class RoleConnectionProperties
{
PlatformName = roleConnection.PlatformName,
PlatformUsername = roleConnection.PlatformUsername,
Metadata = roleConnection.Metadata.ToDictionary()
Metadata = roleConnection.Metadata?.ToDictionary()
};
}