Skip to content

Commit cc2c6b6

Browse files
committed
Avoid NRE when running in VB6 when accessing HostApplication
1 parent 242e6ef commit cc2c6b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Rubberduck.Core/UI/CodeExplorer/Commands/AddComponentCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void AddComponent(CodeExplorerItemViewModel node, string moduleText)
7878
string optionCompare = string.Empty;
7979
using (IHostApplication hostApp = _vbe.HostApplication())
8080
{
81-
optionCompare = hostApp.ApplicationName == "Access" ? "Option Compare Database" :
81+
optionCompare = hostApp?.ApplicationName == "Access" ? "Option Compare Database" :
8282
string.Empty;
8383
}
8484

0 commit comments

Comments
 (0)