Fix Typewriter plugin startup crash (NRE on named controls)#270
Merged
Conversation
MainWindow accessed InfoLabel/EndDelayInput/OkButton as if they were auto-assigned fields, but Avalonia 11 does not generate those out of the box without Avalonia.NameGenerator. Resolve them explicitly via FindControl in InitializeComponent, killing the NullReferenceException that aborted the plugin with exit code 134 right after Avalonia framework init. While here, drop PublishSingleFile/IncludeNativeLibrariesForSelfExtract from the workflow - Avalonia's recommended setup is multi-file self-contained publish, and the single-file extraction was a known source of subtle native-load issues. Bump plugin version to 1.0.1 and point se5-plugins.json at the new se5-typewriter-v1.0.1 release tag so SE shows "Update available" for anyone who installed the broken 1.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the v1.0 Typewriter plugin aborting with exit code 134 right after launch.
Root cause
`MainWindow` accessed `InfoLabel` / `EndDelayInput` / `OkButton` as if they were auto-assigned fields. Avalonia 11 does not generate fields for `x:Name` elements out of the box (that requires the `Avalonia.NameGenerator` package), so every access threw `NullReferenceException` right after `AvaloniaXamlLoader.Load(this)` returned. The unhandled exception aborted the process with SIGABRT — what the host saw as `exited with code 134`.
Resolved by looking the controls up via `FindControl` in `InitializeComponent` and caching them as fields. Verified locally by publishing osx-arm64 and launching with a fake request — window stays up cleanly.
Bonus fixes
Test plan
🤖 Generated with Claude Code