Skip to content

Commit dbb0446

Browse files
committed
Add XML comment to public enum type.
Handle possibilty of there not being a InvocationInfo property on a PSObject.
1 parent 7715882 commit dbb0446

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PowerShellEditorServices/Debugging/StackFrameDetails.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace Microsoft.PowerShell.EditorServices
1010
{
11+
/// <summary>
12+
/// An optional hint for how to present a stack frame in the UI.
13+
/// </summary>
1114
public enum StackFramePresentationHint
1215
{
1316
/// <summary>
@@ -117,7 +120,7 @@ static internal StackFrameDetails Create(
117120
string moduleId = string.Empty;
118121
var presentationHint = StackFramePresentationHint.Normal;
119122

120-
var invocationInfo = callStackFrameObject.Properties["InvocationInfo"].Value as InvocationInfo;
123+
var invocationInfo = callStackFrameObject.Properties["InvocationInfo"]?.Value as InvocationInfo;
121124
string scriptPath = (callStackFrameObject.Properties["ScriptName"].Value as string) ?? NoFileScriptPath;
122125
int startLineNumber = (int)(callStackFrameObject.Properties["ScriptLineNumber"].Value ?? 0);
123126

0 commit comments

Comments
 (0)