Skip to content

fix: graceful fallback for missing external MCCs#4

Merged
midwan merged 1 commit intomasterfrom
fix/graceful-mcc-fallback
May 2, 2026
Merged

fix: graceful fallback for missing external MCCs#4
midwan merged 1 commit intomasterfrom
fix/graceful-mcc-fallback

Conversation

@midwan
Copy link
Copy Markdown
Owner

@midwan midwan commented May 2, 2026

Summary

BetterString.mcc and HotkeyString.mcc were hard runtime dependencies of the preferences editor (MCP). If either was absent, MUI_NewObject returned NULL and the NULL was passed as a MUI Child tag, crashing the system.

Changes

  • ostring() — try BetterStringObject first, fall back to built-in StringObject on failure
  • CreatePrefsGroup() — pre-create the HotkeyString + snoop button HGroup outside the MUI tree; fall back to built-in Keyadjust when HotkeyString.mcc is not installed. Snoop notification setup is guarded by a NULL check.
  • InputClass.cpp — guard SimpleButton(Value) against NULL Value on <input type="button"> without a VALUE attribute (matching the existing guard in the Input_Submit case)
  • README — new README.md with runtime requirements table documenting all optional MCC dependencies and their fallback behavior, plus a changelog covering work since v12

Audit findings (no fix needed)

Component Finding
InputClass.cpp / IsIndexClass.cpp — BetterStringObject Already handles NULL via FLG_Layouted skip
TextAreaClass.cpp — TextEditorObject Already handles NULL gracefully
SelectClass.cpp — CycleObject Built-in MUI class, NULL-checked
ScrollGroup.cpp — ScrollbarObject / RectangleObject Built-in MUI classes, always succeed
CreatePrefsGroup() — CacheSliderClass / GammaSliderClass Internal classes, guaranteed created before use

BetterString.mcc and HotkeyString.mcc were hard runtime dependencies
of the preferences editor (MCP). If either was absent, MUI_NewObject
returned NULL and the NULL was passed as a MUI Child tag, crashing the
system.

- ostring(): try BetterStringObject first, fall back to StringObject
- CreatePrefsGroup(): pre-create HotkeyString+snoop HGroup; fall back
  to built-in Keyadjust when HotkeyString.mcc is absent
- InputClass: guard SimpleButton(Value) against NULL Value on
  <input type="button"> without a VALUE attribute
- Refresh README with runtime requirements table and changelog
@midwan midwan force-pushed the fix/graceful-mcc-fallback branch from 86b3687 to ce7a163 Compare May 2, 2026 17:22
@midwan midwan merged commit 964af83 into master May 2, 2026
4 checks passed
@midwan midwan deleted the fix/graceful-mcc-fallback branch May 2, 2026 17:57
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.

1 participant