Skip to content

Commit 9516bd9

Browse files
Copilotigoravl
andcommitted
Fix null reference exception in InteractiveAuthenticationImpl by using constructor-based dependency injection
Co-authored-by: igoravl <[email protected]>
1 parent a15b878 commit 9516bd9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CSharp/TfsCmdlets/Services/Impl/InteractiveAuthenticationImpl.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ public class InteractiveAuthenticationImpl : IInteractiveAuthentication
1616
private const string CLIENT_ID = "9f44d9a2-86ef-4794-b2b2-f9038a2628e0";
1717
private const string SCOPE_ID = "499b84ac-1321-427f-aa17-267ca6975798/user_impersonation";
1818

19-
[Import]
2019
private IRuntimeUtil RuntimeUtil { get; }
2120

21+
[ImportingConstructor]
22+
public InteractiveAuthenticationImpl(IRuntimeUtil runtimeUtil)
23+
{
24+
RuntimeUtil = runtimeUtil;
25+
}
26+
2227
/// <summary>
2328
/// Determines if we're running in PowerShell Core (vs Windows PowerShell)
2429
/// </summary>

0 commit comments

Comments
 (0)