Skip to content

fix rotate-key crash when no default profile exists#19335

Open
knQzx wants to merge 1 commit into
aptos-labs:mainfrom
knQzx:fix-rotate-key-no-default-profile
Open

fix rotate-key crash when no default profile exists#19335
knQzx wants to merge 1 commit into
aptos-labs:mainfrom
knQzx:fix-rotate-key-no-default-profile

Conversation

@knQzx
Copy link
Copy Markdown

@knQzx knQzx commented Apr 5, 2026

summary

  • fix rotate-key crashing when no default profile exists in config
  • check if config exists before loading default profile, create if needed

test plan

  • verified rotate-key no longer panics without a default profile

fixes #9547


Note

Low Risk
Low risk: changes are limited to CLI profile/config handling when saving the rotated key, mainly adding existence checks and fallbacks to defaults.

Overview
aptos account rotate-key no longer crashes when run without an existing CLI config or a default profile.

The command now checks whether a config file exists before loading it during profile-name validation, creates a default config when saving a new profile if none exists, and builds the new ProfileConfig using a default base profile when the current profile can’t be loaded.

Reviewed by Cursor Bugbot for commit 60e169f. Bugbot is set up for automated code reviews on this repo. Configure here.

@knQzx knQzx requested review from banool and gregnazario as code owners April 5, 2026 12:00
@github-actions
Copy link
Copy Markdown
Contributor

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

@github-actions github-actions Bot added the Stale label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLI] rotate-key can't save new profile if no default profile

2 participants