Adding null check to exception logger

This commit is contained in:
defnotken
2025-09-12 21:37:07 -05:00
parent 8c308ab488
commit 0f72ec4e46

View File

@@ -583,7 +583,14 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.LogWarning(ex, "Failed validating {path}", workload.ResolvedFilepath); if (workload != null)
{
Logger.LogWarning(ex, "Failed validating {path}", workload.ResolvedFilepath);
}
else
{
Logger.LogWarning(ex, "Failed validating unknown workload");
}
} }
Interlocked.Increment(ref _currentFileProgress); Interlocked.Increment(ref _currentFileProgress);
} }