Skip to content

Commit f723e57

Browse files
Fix #817 (Preventative guard against KeyNotFoundException when a vessel/part is outside simulation range)
1 parent 6da383a commit f723e57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RemoteTech/NetworkManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void FindPath(ISatellite start, IEnumerable<ISatellite> commandStations)
112112

113113
public IEnumerable<NetworkLink<ISatellite>> FindNeighbors(ISatellite s)
114114
{
115-
if (!s.Powered) return Enumerable.Empty<NetworkLink<ISatellite>>();
115+
if (!Graph.ContainsKey(s.Guid) || !s.Powered) return Enumerable.Empty<NetworkLink<ISatellite>>();
116116
if (RTSettings.Instance.SignalRelayEnabled)
117117
{
118118
return Graph[s.Guid].Where(l => l.Target.Powered && l.Target.CanRelaySignal);

0 commit comments

Comments
 (0)