Fix nil pointer dereference in flows create command#6
Conversation
The PersistentPreRunE check `cmd.Name() == "create"` was matching all commands named "create", including "flows create". This caused apiClient to remain nil, resulting in a segmentation fault when creating flows. Changed to use `cmdPath == "homeyctl token create"` to only skip config loading for the token create command (which handles its own OAuth). Fixes #4 Fixes #5
📝 WalkthroughWalkthroughThe changes adjust command execution flow to ensure Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🔇 Additional comments (3)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
homeyctl flows createorhomeyctl flows create --advancedcmd.Name() == "create"matching all "create" commands, not justtoken createTest plan
flows createinitializes apiClient correctlytoken createstill skips config loading (handles its own OAuth)Fixes #4
Fixes #5
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.