diff --git a/Source/NETworkManager.Converters/PhysicalAddressToStringConverter.cs b/Source/NETworkManager.Converters/PhysicalAddressToStringConverter.cs index 7e7644468f..cdfe309015 100644 --- a/Source/NETworkManager.Converters/PhysicalAddressToStringConverter.cs +++ b/Source/NETworkManager.Converters/PhysicalAddressToStringConverter.cs @@ -10,7 +10,12 @@ public sealed class PhysicalAddressToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return value == null ? string.Empty : MACAddressHelper.GetDefaultFormat((PhysicalAddress)value); + if (!(value is PhysicalAddress physicalAddress)) + return string.Empty; + + string macAddress = physicalAddress.ToString(); + + return string.IsNullOrEmpty(macAddress) ? string.Empty : MACAddressHelper.GetDefaultFormat(macAddress); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)