Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions Backtrace/Model/JsonData/BacktraceAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,20 @@ private Guid GenerateMachineId()
{
return guid;
}
var networkInterface =
NetworkInterface.GetAllNetworkInterfaces()
.FirstOrDefault(n =>
n.OperationalStatus == OperationalStatus.Up
&& !string.IsNullOrEmpty(n.GetPhysicalAddress()?.ToString())
);

NetworkInterface networkInterface = null;
try
{
networkInterface = NetworkInterface.GetAllNetworkInterfaces()
.FirstOrDefault(n =>
n.OperationalStatus == OperationalStatus.Up
&& !string.IsNullOrEmpty(n.GetPhysicalAddress()?.ToString())
);
}
catch (Exception ex){
Trace.TraceWarning("Failed to retrieve Network Interfaces", ex);
}


if (networkInterface == null)
{
Expand Down
Loading