Skip to content

Fix password-report vault-wide scan when folder argument is omitted#173

Open
mtyagi-ks wants to merge 2 commits into
bug-fix-password-reportfrom
bug-fix-password-report-int
Open

Fix password-report vault-wide scan when folder argument is omitted#173
mtyagi-ks wants to merge 2 commits into
bug-fix-password-reportfrom
bug-fix-password-report-int

Conversation

@mtyagi-ks
Copy link
Copy Markdown

Fix password-report crash when no folder is specified

get_folder('') returns None, so accessing folder.records raised
AttributeError. Scan the whole vault from root_folder via
traverse_folder_tree when no folder argument is given, matching
Commander behavior.


def add_records(folder: vault_types.Folder) -> None:
record_uids.update(folder.records)

Copy link
Copy Markdown

@sali-ks sali-ks May 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoids repeating the function call. like


folder = context.vault.vault_data.root_folder

if folder_uid:
   folder = context.vault.vault_data.get_folder(folder_uid)
   if not folder:
       raise base.CommandError(f'Folder {folder_uid} not found')

vault_utils.traverse_folder_tree(
   context.vault.vault_data,
   folder,
   add_records
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

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.

3 participants