ModuleLimitedDataTransmitter: Add new null gate to CanTransmit.
ModuleLimitedDataTransmitter: Add new null gate to CanTransmit.

--- a/ARConfiguration.cs
+++ b/ARConfiguration.cs
@@ -67,19 +67,22 @@
 		public void OnGUI()
 		{
 			// Only runs once, if the Toolbar is available.
-			if (this.toolbarButton == null && ToolbarManager.ToolbarAvailable)
-			{
-				Tools.PostDebugMessage(this, "Toolbar available; initializing toolbar button.");
-
-				this.toolbarButton = ToolbarManager.Instance.add("AntennaRange", "ARConfiguration");
-				this.toolbarButton.Visibility = new GameScenesVisibility(GameScenes.SPACECENTER);
-				this.toolbarButton.Text = "AR";
-				this.toolbarButton.TexturePath = "AntennaRange/Textures/toolbarIcon";
-				this.toolbarButton.TextColor = (Color)XKCDColors.Amethyst;
-				this.toolbarButton.OnClick += delegate(ClickEvent e)
-				{
-					this.toggleConfigWindow();
-				};
+			if (ToolbarManager.ToolbarAvailable)
+			{
+				if (this.toolbarButton == null)
+				{
+					Tools.PostDebugMessage(this, "Toolbar available; initializing toolbar button.");
+
+					this.toolbarButton = ToolbarManager.Instance.add("AntennaRange", "ARConfiguration");
+					this.toolbarButton.Visibility = new GameScenesVisibility(GameScenes.SPACECENTER);
+					this.toolbarButton.Text = "AR";
+					this.toolbarButton.TexturePath = "AntennaRange/Textures/toolbarIcon";
+					this.toolbarButton.TextColor = (Color)XKCDColors.Amethyst;
+					this.toolbarButton.OnClick += delegate(ClickEvent e)
+					{
+						this.toggleConfigWindow();
+					};
+				}
 			}
 			else if (this.appLauncherButton == null && ApplicationLauncher.Ready)
 			{
@@ -90,7 +93,7 @@
 					this.toggleConfigWindow,
 					ApplicationLauncher.AppScenes.SPACECENTER,
 					GameDatabase.Instance.GetTexture(
-						"AntennaRange/Textures/toolbarIcon",
+						"AntennaRange/Textures/appLauncherIcon",
 						false
 					)
 				);

--- a/ARFlightController.cs
+++ b/ARFlightController.cs
@@ -43,6 +43,7 @@
 
 		#region Fields
 		protected Dictionary<ConnectionStatus, string> connectionTextures;
+		protected Dictionary<ConnectionStatus, Texture> appLauncherTextures;
 
 		protected IButton toolbarButton;
 
@@ -61,6 +62,14 @@
 			get
 			{
 				return this.connectionTextures[this.currentConnectionStatus];
+			}
+		}
+
+		protected Texture currentAppLauncherTexture
+		{
+			get
+			{
+				return this.appLauncherTextures[this.currentConnectionStatus];
 			}
 		}
 
@@ -115,6 +124,15 @@
 			this.connectionTextures[ConnectionStatus.None] = "AntennaRange/Textures/toolbarIconNoConnection";
 			this.connectionTextures[ConnectionStatus.Suboptimal] = "AntennaRange/Textures/toolbarIconSubOptimal";
 			this.connectionTextures[ConnectionStatus.Optimal] = "AntennaRange/Textures/toolbarIcon";
+
+			this.appLauncherTextures = new Dictionary<ConnectionStatus, Texture>();
+
+			this.appLauncherTextures[ConnectionStatus.None] =
+				GameDatabase.Instance.GetTexture("AntennaRange/Textures/appLauncherIconNoConnection", false);
+			this.appLauncherTextures[ConnectionStatus.Suboptimal] =
+				GameDatabase.Instance.GetTexture("AntennaRange/Textures/appLauncherIconSubOptimal", false);
+			this.appLauncherTextures[ConnectionStatus.Optimal] =
+				GameDatabase.Instance.GetTexture("AntennaRange/Textures/appLauncherIcon", false);
 
 			if (ToolbarManager.ToolbarAvailable)
 			{
@@ -136,7 +154,7 @@
 			{
 				this.appLauncherButton = ApplicationLauncher.Instance.AddModApplication(
 					ApplicationLauncher.AppScenes.FLIGHT,
-					GameDatabase.Instance.GetTexture("AntennaRange/Textures/toolbarIconNoConnection", false)
+					this.appLauncherTextures[ConnectionStatus.None]
 				);
 			}
 
@@ -240,8 +258,7 @@
 				}
 				if (this.appLauncherButton != null)
 				{
-					this.appLauncherButton.SetTexture(
-						GameDatabase.Instance.GetTexture(this.currentConnectionTexture, false));
+					this.appLauncherButton.SetTexture(this.currentAppLauncherTexture);
 				}
 			}
 

--- a/ModuleLimitedDataTransmitter.cs
+++ b/ModuleLimitedDataTransmitter.cs
@@ -341,6 +341,11 @@
 		// Override ModuleDataTransmitter.CanTransmit to return false when transmission is not possible.
 		public new bool CanTransmit()
 		{
+			if (this.part == null || this.relay == null)
+			{
+				return false;
+			}
+
 			PartStates partState = this.part.State;
 			if (partState == PartStates.DEAD || partState == PartStates.DEACTIVATED)
 			{

 Binary files a/toolbarIcon.xcf and b/toolbarIcon.xcf differ
 Binary files /dev/null and b/toolbarIcon_24x24.xcf differ
 Binary files /dev/null and b/toolbarIcon_38x38.xcf differ