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

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