Skip to content

Commit ecfad83

Browse files
committed
Fix for #61 - PSObject not unwrapped when determining if a PSVariable's value is expandable.
1 parent 0d4486d commit ecfad83

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/PowerShellEditorServices/Debugging/VariableDetails.cs

+12
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ public override VariableDetailsBase[] GetChildren()
113113

114114
private static bool GetIsExpandable(object valueObject)
115115
{
116+
if (valueObject == null)
117+
{
118+
return false;
119+
}
120+
121+
// If a PSObject, unwrap it
122+
var psobject = valueObject as PSObject;
123+
if (psobject != null)
124+
{
125+
valueObject = psobject.BaseObject;
126+
}
127+
116128
Type valueType =
117129
valueObject != null ?
118130
valueObject.GetType() :

0 commit comments

Comments
 (0)