Adding protection against a null parent reference. (#26)

Found this via ReadAll on my history. I can now process all my history without error.
This commit is contained in:
F K 2021-10-29 07:06:18 -04:00 committed by GitHub
commit deee600a65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -177,7 +177,7 @@ namespace Observatory.Explorer
var results = DefaultCriteria.CheckInterest(scanEvent, SystemBodyHistory, BodySignalHistory, (ExplorerSettings)ExplorerWorker.Settings);
if (BarycentreHistory.ContainsKey(scanEvent.SystemAddress) && BarycentreHistory[scanEvent.SystemAddress].ContainsKey(scanEvent.Parent[0].Body))
if (BarycentreHistory.ContainsKey(scanEvent.SystemAddress) && scanEvent.Parent != null && BarycentreHistory[scanEvent.SystemAddress].ContainsKey(scanEvent.Parent[0].Body))
{
ProcessScan(ConvertBarycentre(BarycentreHistory[scanEvent.SystemAddress][scanEvent.Parent[0].Body], scanEvent), readAll);
}