File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Rubberduck.VBEEditor/Extensions Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,21 @@ public static class ProjectExtensions
1010 public static string ProjectName ( this VBProject project )
1111 {
1212 var projectName = project . Name ;
13- var documentModule = project
14- . VBComponents . Cast < VBComponent > ( )
15- . FirstOrDefault ( item => item . Type == vbext_ComponentType . vbext_ct_Document ) ;
16-
17- if ( documentModule != null )
13+ if ( project . Protection == vbext_ProjectProtection . vbext_pp_none )
1814 {
19- var hostDocumentNameProperty = documentModule . Properties . Item ( "Name" ) ;
20- if ( hostDocumentNameProperty != null )
15+ var documentModule = project
16+ . VBComponents . Cast < VBComponent > ( )
17+ . FirstOrDefault ( item => item . Type == vbext_ComponentType . vbext_ct_Document ) ;
18+
19+ if ( documentModule != null )
2120 {
22- projectName += string . Format ( " ({0})" , hostDocumentNameProperty . Value ) ;
21+ var hostDocumentNameProperty = documentModule . Properties . Item ( "Name" ) ;
22+ if ( hostDocumentNameProperty != null )
23+ {
24+ projectName += string . Format ( " ({0})" , hostDocumentNameProperty . Value ) ;
25+ }
2326 }
2427 }
25-
2628 return projectName ;
2729 }
2830
You can’t perform that action at this time.
0 commit comments