FileValidationService: outer catch NullRefs when fileData is null #797

Open
opened 2026-07-22 09:14:58 +00:00 by spikerj · 0 comments
Owner

Summary

ValidateDotNetAssembly outer catch logs with fileData.FileName. If fileData itself is null (or the failure path NRE'd before assignment), the catch throws a second NullReferenceException instead of returning FileValidationResult.Failure.

Repro

Pinned characterization: FileValidationServiceTests.ValidateDotNetAssembly_NullFileData_ThrowsInsteadOfFailing on PR #454 / test/coverage-wave-2026-07.

Fix

Use null-conditional in the log (fileData?.FileName) and/or guard fileData is null at method entry.

Impact

Unexpected null DTO crashes the call site instead of a structured validation failure.

## Summary `ValidateDotNetAssembly` outer `catch` logs with `fileData.FileName`. If `fileData` itself is null (or the failure path NRE'd before assignment), the catch throws a second `NullReferenceException` instead of returning `FileValidationResult.Failure`. ## Repro Pinned characterization: `FileValidationServiceTests.ValidateDotNetAssembly_NullFileData_ThrowsInsteadOfFailing` on PR #454 / `test/coverage-wave-2026-07`. ## Fix Use null-conditional in the log (`fileData?.FileName`) and/or guard `fileData is null` at method entry. ## Impact Unexpected null DTO crashes the call site instead of a structured validation failure.
Sign in to join this conversation.