Type assignment change

This commit is contained in:
Brett Hewitson 2021-12-15 22:26:33 +10:00
parent 5c06fd00d5
commit cd9d36a51d

View file

@ -171,8 +171,7 @@ namespace ServerManagerTool.Common.Model
kvPropertyValue = kvPropertyValue.Substring(0, kvPropertyValue.Length - 1);
}
var collection = property.GetValue(this) as IIniValuesCollection;
if (collection != null)
if (property.GetValue(this) is IIniValuesCollection collection)
{
var values = SplitCollectionValues(kvPropertyValue, DELIMITER);
values = values.Where(v => !string.IsNullOrWhiteSpace(v)).ToArray();