File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,21 @@ public static AttributeAst GetCmdletBindingAttributeAst(this ParamBlockAst param
5656 {
5757 throw new ArgumentNullException ( "attributeAsts" ) ;
5858 }
59+
5960 foreach ( var attributeAst in attributeAsts )
6061 {
61- if ( attributeAst == null || attributeAst . NamedArguments == null )
62- {
63- continue ;
64- }
65- if ( attributeAst . TypeName . GetReflectionAttributeType ( )
66- == typeof ( CmdletBindingAttribute ) )
62+ if ( attributeAst != null && attributeAst . IsCmdletBindingAttributeAst ( ) )
6763 {
6864 return attributeAst ;
6965 }
7066 }
67+
7168 return null ;
7269 }
70+
71+ public static bool IsCmdletBindingAttributeAst ( this AttributeAst attributeAst )
72+ {
73+ return attributeAst . TypeName . GetReflectionAttributeType ( ) == typeof ( CmdletBindingAttribute ) ;
74+ }
7375 }
7476}
You can’t perform that action at this time.
0 commit comments