Skip to content

Commit 0c22695

Browse files
Update src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 40df2ec commit 0c22695

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ private static async Task<DeviceCodeCredential> GetDeviceCodeCredentialAsync(IAu
167167
GraphSession.Instance.OutputWriter.WriteObject(code.Message);
168168
return Task.CompletedTask;
169169
}
170-
catch
170+
catch (InvalidOperationException)
171+
{
172+
// Fall through to console output if OutputWriter is unavailable.
173+
}
174+
catch (ObjectDisposedException)
171175
{
172176
// Fall through to console output if OutputWriter is unavailable.
173177
}

0 commit comments

Comments
 (0)