Skip to content

Commit 966bbb6

Browse files
committed
Speculative fix for Rollbar# 29794 and Rollbar#29795 - both having to do with task cancellations and subsequent null references.
1 parent dc364ec commit 966bbb6

5 files changed

Lines changed: 157 additions & 150 deletions

File tree

DataProviderService/DataProviderService.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ public class DataProviderService
2323
internal readonly SpanshService spanshService;
2424
internal readonly StarSystemSqLiteRepository starSystemRepository;
2525

26-
internal readonly FactionCache factionCache;
27-
internal readonly StarSystemCache starSystemCache;
26+
private readonly FactionCache factionCache;
27+
private readonly StarSystemCache starSystemCache;
28+
29+
public readonly CancellationTokenSource cts = new CancellationTokenSource();
2830

2931
public static bool unitTesting;
3032

@@ -520,7 +522,7 @@ public async Task<NavWaypointCollection> FetchGalaxyRouteAsync ( string currentS
520522
internal async Task<IList<StarSystem>> FetchSystemsDataAsync ( ulong[] systemAddresses, bool showMarketDetails )
521523
{
522524
if ( systemAddresses == null || systemAddresses.Length == 0 ) { return new List<StarSystem>(); }
523-
return await spanshService.GetStarSystemsAsync( systemAddresses, showMarketDetails, CancellationToken.None );
525+
return await spanshService.GetStarSystemsAsync( systemAddresses, showMarketDetails, cts.Token );
524526
}
525527

526528
/// <summary>

0 commit comments

Comments
 (0)