Skip to content

Fix panic when updating properties of a missing layer - #195

Merged
mkrueger merged 1 commit into
mkrueger:masterfrom
PerchAnton:codex/fix-layer-properties-bounds
Oct 27, 2026
Merged

mkrueger merged 1 commit into
mkrueger:masterfrom
PerchAnton:codex/fix-layer-properties-bounds

Conversation

@PerchAnton

Copy link
Copy Markdown
Contributor

EditState::update_layer_properties indexes layers[layer] after checks that allow a missing index through. A stale index, usize::MAX, or an empty buffer therefore panics instead of returning an error. This affects both locked and unlocked property requests.

Check that the target exists before starting an undo group or building an undo operation. Add tests for invalid indices, an empty buffer, preserving the existing redo branch, and valid lock changes remaining undoable. No dependency or UI behavior change is included.

Validation on Windows / Rust 1.96: before the fix, two regression tests panic at layer_operations.rs:843 and the valid-operation control passes. After the fix, all three new tests and all 43 existing layer-operation tests pass. The existing test file was run unchanged through an isolated Cargo harness against the local patched crates with default features disabled; the full workspace suite has not been run locally. rustfmt and git diff --check pass. Upstream CI remains to be checked.

AI-assisted investigation and implementation with Codex.

@mkrueger
mkrueger merged commit cc50f10 into mkrueger:master Oct 27, 2026
1 check failed
@PerchAnton

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and merging the fix. I appreciate your time and help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants