[GH-ISSUE #1559] [Issue]: Character Editor crashes when corrupt card has no extensions.avatarCrop #802

Closed
opened 2026-10-21 05:21:19 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Promansis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1559

Originally assigned to: @Romuromylus on GitHub.

Summary

Opening a corrupt or minimal character card can crash CharacterEditor when extensions is missing and the editor reads formData?.extensions.avatarCrop.

Parent smoke test: #1485

Expected behavior

The Character Editor should tolerate character data with missing extensions and default optional extension fields safely. A corrupt or partial card should show a recoverable editor/error state rather than crashing the route.

Actual behavior

Opening a corrupt character produced an uncaught TypeError reading avatarCrop from undefined.

Steps to reproduce

  1. Import or open a character whose parsed card data has no extensions object.
  2. Open the character in the Character Editor.
  3. Observe the editor crash.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor branch, reported during manual Catalog Editors sweep on 2026-05-29
  • Run mode: browser/Tauri UI, exact mode not specified
  • OS + version: not specified
  • Node + pnpm versions: not specified
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Console excerpt from report:

CharacterEditor.tsx:427 Uncaught TypeError: Cannot read properties of undefined (reading 'avatarCrop')
    at CharacterEditor (CharacterEditor.tsx:427:17)
detail-route-registry.tsx:61 An error occurred in the <CharacterEditor> component.

Source evidence inspected: src/features/catalog/characters/components/CharacterEditor.tsx has several formData.extensions.* reads; the reported line aligns with formData?.extensions.avatarCrop, which still dereferences extensions when it is undefined.

Regression notes

Unknown. Related historical issue #667 was a closed new-format avatar crop crash, but this report is specifically about missing extensions/undefined avatarCrop.

Additional context

Checked upstream issues and PRs for CharacterEditor, avatarCrop, corrupt character, and undefined extension overlap. No open issue found for this current crash shape.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1559 Originally assigned to: @Romuromylus on GitHub. ## Summary Opening a corrupt or minimal character card can crash `CharacterEditor` when `extensions` is missing and the editor reads `formData?.extensions.avatarCrop`. Parent smoke test: #1485 ## Expected behavior The Character Editor should tolerate character data with missing `extensions` and default optional extension fields safely. A corrupt or partial card should show a recoverable editor/error state rather than crashing the route. ## Actual behavior Opening a corrupt character produced an uncaught TypeError reading `avatarCrop` from `undefined`. ## Steps to reproduce 1. Import or open a character whose parsed card data has no `extensions` object. 2. Open the character in the Character Editor. 3. Observe the editor crash. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor branch, reported during manual Catalog Editors sweep on 2026-05-29 - Run mode: browser/Tauri UI, exact mode not specified - OS + version: not specified - Node + pnpm versions: not specified - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Console excerpt from report: ```text CharacterEditor.tsx:427 Uncaught TypeError: Cannot read properties of undefined (reading 'avatarCrop') at CharacterEditor (CharacterEditor.tsx:427:17) detail-route-registry.tsx:61 An error occurred in the <CharacterEditor> component. ``` Source evidence inspected: `src/features/catalog/characters/components/CharacterEditor.tsx` has several `formData.extensions.*` reads; the reported line aligns with `formData?.extensions.avatarCrop`, which still dereferences `extensions` when it is undefined. ## Regression notes Unknown. Related historical issue #667 was a closed new-format avatar crop crash, but this report is specifically about missing `extensions`/undefined `avatarCrop`. ## Additional context Checked upstream issues and PRs for `CharacterEditor`, `avatarCrop`, corrupt character, and undefined extension overlap. No open issue found for this current crash shape. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:21:19 +07:00
Author
Owner

@Romuromylus commented on GitHub (May 29, 2026):

Resolved by #1600, merged into refactor.

<!-- gh-comment-id:4580147920 --> @Romuromylus commented on GitHub (May 29, 2026): Resolved by #1600, merged into `refactor`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#802
No description provided.