Guard Level Settings static-mesh bindings against missing/stale merge entries#1212
Guard Level Settings static-mesh bindings against missing/stale merge entries#1212Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/8e9f590f-8231-4541-ab43-ad4af3742a46 Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
|
@copilot Would you be able to provide reproduction steps for the original issue? What do we have to do in order to get the original error before the fix was applied? Also, please double-check that the changes don't cause any regressions for other places in the code. |
I re-checked this around 6dd15f0. The easiest pre-fix repro is:
There is also a clone-related variant: opening Level Settings clones I have not been able to prove the exact "brand new empty level" sequence from the original report in this Linux sandbox, but the failure path above matches the stack/behavior and is what the fix addresses. For regressions, I re-checked all
|
Opening Level Settings could throw from
DataGridViewbindings when the Static Meshes tab evaluated merged static entries with no resolvable backing static mesh. The same failure mode could surface anywhere cloned merge entries retained a staleLevelSettingsparent.Problem
AutoStaticMeshMergeEntry.StaticMeshassumedWadTryGetStatic(...)always returned a mesh and immediately dereferenced it.LevelSettings.Clone()preserved the originalparentreference inside cloned merge entries, so bindings could resolve against outdated settings state.Changes
AutoStaticMeshMergeEntry.StaticMeshwith a guarded lookup.AutoStaticMeshMergeEntryto the clonedLevelSettings.LevelSettings.Clone()to use the reparenting clone so merge entries no longer retain stale references.Result
TargetInvocationException/null-reference path from the Static Meshes tab and related bindings.Example