Skip to content

Commit

Permalink
fix new device
Browse files Browse the repository at this point in the history
  • Loading branch information
spektor56 committed Jun 12, 2024
1 parent 420fb4b commit 95e115a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions OpenpilotToolkit/OpenpilotToolkitForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,21 @@ await Task.Run(async () =>
if (!_devices.Contains(device))
{
if (!device.IsAuthenticated)
if (device is not UnknownDevice)
{
await device.ConnectSftpAsync().ConfigureAwait(false);
if (!device.IsAuthenticated)
{
try
{
await device.ConnectSftpAsync().ConfigureAwait(false);
}
catch (SshAuthenticationException ex)
{
Serilog.Log.Information(ex, "Authentication failed for {Device}", device);
}
}
}
if (device.IsAuthenticated)
{
Invoke(new MethodInvoker(async () =>
Expand Down

0 comments on commit 95e115a

Please sign in to comment.