mirror of
https://github.com/PowerShell/PSReadLine
synced 2026-06-08 12:12:13 +00:00
Fix a null-ref exception in DynamicHelpImpl (#2292)
This commit is contained in:
@@ -151,6 +151,9 @@ namespace Microsoft.PowerShell
|
||||
string commandName = null;
|
||||
string parameterName = null;
|
||||
|
||||
// Simply return if nothing is rendered yet.
|
||||
if (_singleton._tokens == null) { return; }
|
||||
|
||||
foreach(var token in _singleton._tokens)
|
||||
{
|
||||
var extent = token.Extent;
|
||||
|
||||
@@ -97,6 +97,13 @@ PARAMETERS
|
||||
return paramHelp;
|
||||
}
|
||||
|
||||
[SkippableFact]
|
||||
public void DynHelp_GetFullHelp_OnEmptyLine()
|
||||
{
|
||||
TestSetup(KeyMode.Cmd);
|
||||
Test("", Keys(_.F1, _.Enter));
|
||||
}
|
||||
|
||||
[SkippableFact]
|
||||
public void DynHelp_GetFullHelp()
|
||||
{
|
||||
@@ -108,6 +115,13 @@ PARAMETERS
|
||||
));
|
||||
}
|
||||
|
||||
[SkippableFact]
|
||||
public void DynHelp_GetParameterHelp_OnEmptyLine()
|
||||
{
|
||||
TestSetup(KeyMode.Cmd);
|
||||
Test("", Keys(_.Alt_h, _.Enter));
|
||||
}
|
||||
|
||||
[SkippableFact]
|
||||
public void DynHelp_GetParameterHelp_And_Clear()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user