Skip to content

Commit db310fe

Browse files
committed
ConfigGateway - IPv4Gateway NullReferenceException during launch fixed. When there is no gateway given in network adapter IPv4 settings.
1 parent a19055c commit db310fe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Source/NETworkManager/ViewModels/Applications/NetworkInterfaceViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ public NetworkInterfaceInfo SelectedNetworkInterface
144144
ConfigEnableStaticIPAddress = true;
145145
ConfigIPAddress = value.IPv4Address.FirstOrDefault().ToString();
146146
ConfigSubnetmaskOrCidr = value.Subnetmask.FirstOrDefault().ToString();
147-
ConfigGateway = value.IPv4Gateway.FirstOrDefault().ToString();
147+
if (value.IPv4Gateway.FirstOrDefault() != null)
148+
ConfigGateway = value.IPv4Gateway.FirstOrDefault().ToString();
148149
}
149150

150151
if (value.DNSAutoconfigurationEnabled)

0 commit comments

Comments
 (0)