mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Merge pull request #889 from PowerShell/help
Fixes seg fault when Get-Help cannot find topic
This commit is contained in:
commit
71ac45467e
1 file changed
+5
-1
@@ -62,7 +62,11 @@ namespace Microsoft.PowerShell.Commands
|
||||
/// </summary>
|
||||
private void CreateErrorRecord()
|
||||
{
|
||||
_errorRecord = new ErrorRecord(new ParentContainsErrorRecordException(this), "HelpNotFound", ErrorCategory.ResourceUnavailable, null);
|
||||
string errMessage = string.Format(HelpErrors.HelpNotFound, _helpTopic);
|
||||
|
||||
// Don't do ParentContainsErrorRecordException(this), as this causes recursion, and creates a
|
||||
// segmentation fault on Linux
|
||||
_errorRecord = new ErrorRecord(new ParentContainsErrorRecordException(errMessage), "HelpNotFound", ErrorCategory.ResourceUnavailable, null);
|
||||
_errorRecord.ErrorDetails = new ErrorDetails(typeof(HelpNotFoundException).GetTypeInfo().Assembly, "HelpErrors", "HelpNotFound", _helpTopic);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user