Skip to content

Commit 34f9aa4

Browse files
author
Kapil Borle
committed
Fix loading custom rules that do not have comment help
Add conditions to check if indexing does not take place on a null valued Value property. If a PowerShell based custom rule does't have comment based help, the engine throws an error. This occurs because the lack of comment based help results in a null value for the Value property of the dynamically typed description variable.
1 parent 8bd5a97 commit 34f9aa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Engine/ScriptAnalyzer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,8 @@ private List<ExternalRule> GetExternalRule(string[] moduleNames)
764764
{
765765
dynamic description = helpContent[0].Properties["Description"];
766766

767-
if (null != description)
768-
{
767+
if (null != description && null != description.Value && description.Value.GetType().IsArray)
768+
{
769769
desc = description.Value[0].Text;
770770
}
771771
}

0 commit comments

Comments
 (0)