Skip to content

fix: skip hook when code assets are disabled - #17

Open
HeyChengdu wants to merge 1 commit into
GigaDroid:masterfrom
skillsgo:fix/skip-non-code-assets-builds
Open

fix: skip hook when code assets are disabled#17
HeyChengdu wants to merge 1 commit into
GigaDroid:masterfrom
skillsgo:fix/skip-non-code-assets-builds

Conversation

@HeyChengdu

Copy link
Copy Markdown

The code_assets API documents HookConfig.code as available only when buildCodeAssets is true. Flutter 3.44.6 can invoke this build hook during flutter run without requesting Code Assets, so the unconditional access currently throws from CodeConfig._fromJson after the macOS app has compiled and launched.

This guard makes that unsupported hook invocation a successful no-op while preserving the existing Rust build path whenever Code Assets are requested.

Reproduction before the fix:

flutter run -d macos
✓ Built build/macos/Build/Products/Debug/SkillsGo.app
Null check operator used on a null value
CodeConfig._fromJson
Building assets for package:velopack_flutter failed.

Verified after the fix:

  • flutter run -d macos reaches the Dart VM Service and restores hot reload
  • flutter analyze passes in this package

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