Fix Export NullReferenceException for images/resourcexsd.baml - #3806
Conversation
Object reference not set to an instance of an object."
siegfriedpammer
left a comment
There was a problem hiding this comment.
Approved. Correct, minimal fix: ProjectItemInfo.AdditionalProperties defaults to null, so the old loop dereferenced null on the first .Add(); routing through With(...) lazily allocates the dictionary. No regression risk and matches the reported stack trace.
(This review was written by an AI agent on behalf of Siegfried Pammer.)
siegfriedpammer
left a comment
There was a problem hiding this comment.
Approved. Correct, minimal fix: ProjectItemInfo is a record struct whose AdditionalProperties defaults to null, so the old loop dereferenced null on the first .Add(). Routing through With(...) lazily allocates the dictionary via ??=. Matches the reported stack trace; no regression risk (consumers already null-guard AdditionalProperties).
(This review was written by an AI agent on behalf of Siegfried Pammer.)
Trying to Export ilspy.dll 10.0.0.8345
Fix via VS Debugger Agent: