Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions PSReadLine/DynamicHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ private void WriteParameterHelp(dynamic helpContent)
{
Collection<string> helpBlock;

if (string.IsNullOrEmpty(helpContent?.Description?[0]?.Text))
if (helpContent?.Description is not string descriptionText)
{
descriptionText = helpContent?.Description?[0]?.Text;
}

if (descriptionText is null)
{
helpBlock = new Collection<string>()
{
Expand All @@ -216,7 +221,7 @@ private void WriteParameterHelp(dynamic helpContent)
string.Empty
};

string text = helpContent.Description[0].Text;
string text = descriptionText;
if (text.Contains("\n"))
{
string[] lines = text.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
Expand Down