diff --git a/roles/lib/files/FWO.Api.Client/Data/DisplayBase.cs b/roles/lib/files/FWO.Api.Client/Data/DisplayBase.cs index cf13837d9..5512310b2 100644 --- a/roles/lib/files/FWO.Api.Client/Data/DisplayBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/DisplayBase.cs @@ -121,6 +121,17 @@ public static string DisplayIp(string ip1, string ip2, string nwObjType, bool in string result = ""; if (nwObjType != ObjectType.Group) { + + if (string.IsNullOrEmpty(ip2)) + { + ip2 = ip1; + } + + if (string.IsNullOrEmpty(ip1)) + { + Log.WriteDebug("Ip displaying", $"Parameter {nameof(ip1)} is empty."); + } + if (!IsV4Address(ip1) && !IsV6Address(ip1)) { Log.WriteError("Ip displaying", $"Found undefined IP family: {ip1} - {ip2}"); @@ -130,11 +141,7 @@ public static string DisplayIp(string ip1, string ip2, string nwObjType, bool in Log.WriteError("Ip displaying", $"Found mixed IP family: {ip1} - {ip2}"); } else - { - if (ip2 == "") - { - ip2 = ip1; - } + { string IpStart = StripOffUnnecessaryNetmask(ip1); string IpEnd = StripOffUnnecessaryNetmask(ip2);