Skip to content

Commit d3e0a40

Browse files
authored
Fix possible crash in IntelliSenseServer.Uninstall()
If intellisense is disabled, IntelliSenseServer.Install() returns early, but not IntelliSenseServer.Uninstall(), which will then throw a NullReferenceException because environment variable EXCELDNA_INTELLISENSE_SERVERS has not been set.
1 parent 1899bd1 commit d3e0a40

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Source/ExcelDna.IntelliSense/IntelliSenseServer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ public static void Install()
111111
public static void Uninstall()
112112
{
113113
Logger.Initialization.Info($"IntelliSenseServer.Uninstall Begin: Version {ServerVersion} in {AppDomain.CurrentDomain.FriendlyName}");
114+
if (IsDisabled())
115+
return;
114116

115117
UnpublishRegistration();
116118
if (_isActive)

0 commit comments

Comments
 (0)