Skip to content

Commit

Permalink
Fixed: Crash in Texture Cache Service
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Jun 13, 2023
1 parent 2651d68 commit 80cf05e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Riders.Tweakbox/Services/Texture/TextureCacheService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public TextureCacheService(IO io)
/// <param name="data">The raw DDS texture data to cache.</param>
public void Store(string filePath, Span<byte> data)
{
var entry = CollectionsMarshal.GetValueRefOrNullRef(_textureCache, filePath);
if (!_textureCache.TryGetValue(filePath, out var entry))
entry = new TextureCacheEntry();

entry.LastWriteTime = File.GetLastWriteTimeUtc(filePath);
entry.LastAccessTime = DateTime.UtcNow;
if (string.IsNullOrEmpty(entry.Target))
Expand Down

0 comments on commit 80cf05e

Please sign in to comment.