lukesampson / pshazz

Give your powershell some pizazz.
The Unlicense
577 stars 40 forks source link

Error when switching to a theme with null prompt #41

Closed eugenesvk closed 8 years ago

eugenesvk commented 8 years ago

When trying to switch to a theme without prompt (e.g. pshazz use keepprompt) I get the following error:

You cannot call a method on a null-valued expression.
At C:\dev\apps\pshazz\0.2016.03.24.1\lib\core.ps1:31 char:5
+     if($obj.gettype().name -eq 'pscustomobject') { # -is is unreliabl ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\dev\apps\pshazz\0.2016.03.24.1\lib\core.ps1:31 char:5
+     if($obj.gettype().name -eq 'pscustomobject') { # -is is unreliabl ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

UPDATE: I think this error also prevents reading and setting vars from theme.json on opening a new instance. E.g. $global:pshazz.theme.git is properly populated when I use pshazz use keepprompt, but is empty when I open a new powershell instance.