Skip to content

Commit dc740c0

Browse files
committed
Merge pull request #62 from PowerShell/rkeithhill/variable-unwrap-bugfix
Fix for #61 - PSObject not unwrapped when determining if a PSVariable…
2 parents 0d4486d + ecfad83 commit dc740c0

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)