ARFlightController: Make sure the active vessel has any relays before we try to use them. GeometricRanges
ARFlightController: Make sure the active vessel has any relays before we try to use them.

--- a/ARFlightController.cs
+++ b/ARFlightController.cs
@@ -281,26 +281,31 @@
 					}
 				}
 
-				bestActiveRelay = RelayDatabase.Instance.GetBestVesselRelay(FlightGlobals.ActiveVessel);
 				activeVesselRelays = RelayDatabase.Instance[FlightGlobals.ActiveVessel];
-				for (int rIdx = 0; rIdx < activeVesselRelays.Count; rIdx++)
-				{
-					relay = activeVesselRelays[rIdx];
-
-					// The best active relay will get checked with the other useful relays later.
-					if (relay == bestActiveRelay)
+
+				if (activeVesselRelays.Count > 0)
+				{
+					bestActiveRelay = RelayDatabase.Instance.GetBestVesselRelay(FlightGlobals.ActiveVessel);
+
+					for (int rIdx = 0; rIdx < activeVesselRelays.Count; rIdx++)
 					{
-						continue;
+						relay = activeVesselRelays[rIdx];
+
+						// The best active relay will get checked with the other useful relays later.
+						if (relay == bestActiveRelay)
+						{
+							continue;
+						}
+
+						log.AppendFormat("\nFinding nearest relay for active vessel relay {0}", relay);
+
+						relay.FindNearestRelay();
 					}
 
-					log.AppendFormat("\nFinding nearest relay for active vessel relay {0}", relay);
-
-					relay.FindNearestRelay();
-				}
-
-				log.AppendFormat("\n\tAdding best active vessel relay {0} to usefulRelays", bestActiveRelay);
-
-				usefulRelays.Add(bestActiveRelay);
+					log.AppendFormat("\n\tAdding best active vessel relay {0} to usefulRelays", bestActiveRelay);
+
+					usefulRelays.Add(bestActiveRelay);
+				}
 
 				log.AppendFormat("\n\tDoing target searches for {0} useful relays", usefulRelays.Count);