Skip to content

Commit 91810ec

Browse files
committed
Add nullability to files
1 parent 70750f1 commit 91810ec

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/PowerShellEditorServices/Hosting/HostStartupInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
3+
#nullable enable
34

45
using System;
56
using System.Collections.Generic;

src/PowerShellEditorServices/Services/PowerShell/Utility/PowerShellExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
3-
3+
#nullable enable
44
using System;
55
using System.Collections.Generic;
66
using System.Collections.ObjectModel;
@@ -69,7 +69,7 @@ and not PSInvocationState.Failed
6969
pwsh.InvocationStateChanged += handler;
7070
}
7171

72-
public static Collection<TResult> InvokeAndClear<TResult>(this PowerShell pwsh, PSInvocationSettings invocationSettings = null)
72+
public static Collection<TResult> InvokeAndClear<TResult>(this PowerShell pwsh, PSInvocationSettings? invocationSettings = null)
7373
{
7474
try
7575
{
@@ -81,7 +81,7 @@ public static Collection<TResult> InvokeAndClear<TResult>(this PowerShell pwsh,
8181
}
8282
}
8383

84-
public static void InvokeAndClear(this PowerShell pwsh, PSInvocationSettings invocationSettings = null)
84+
public static void InvokeAndClear(this PowerShell pwsh, PSInvocationSettings? invocationSettings = null)
8585
{
8686
try
8787
{
@@ -93,13 +93,13 @@ public static void InvokeAndClear(this PowerShell pwsh, PSInvocationSettings inv
9393
}
9494
}
9595

96-
public static Collection<TResult> InvokeCommand<TResult>(this PowerShell pwsh, PSCommand psCommand, PSInvocationSettings invocationSettings = null)
96+
public static Collection<TResult> InvokeCommand<TResult>(this PowerShell pwsh, PSCommand psCommand, PSInvocationSettings? invocationSettings = null)
9797
{
9898
pwsh.Commands = psCommand;
9999
return pwsh.InvokeAndClear<TResult>(invocationSettings);
100100
}
101101

102-
public static void InvokeCommand(this PowerShell pwsh, PSCommand psCommand, PSInvocationSettings invocationSettings = null)
102+
public static void InvokeCommand(this PowerShell pwsh, PSCommand psCommand, PSInvocationSettings? invocationSettings = null)
103103
{
104104
pwsh.Commands = psCommand;
105105
pwsh.InvokeAndClear(invocationSettings);
@@ -262,7 +262,7 @@ private static StringBuilder AddErrorString(this StringBuilder sb, ErrorRecord e
262262
.AppendLine("Exception:")
263263
.Append(" ").Append(error.Exception.ToString() ?? "<null>");
264264

265-
Exception innerException = error.Exception?.InnerException;
265+
Exception? innerException = error.Exception?.InnerException;
266266
while (innerException != null)
267267
{
268268
sb.AppendLine("InnerException:")

0 commit comments

Comments
 (0)