Skip to content

Commit

Permalink
fix(cli): crash when user prefs is missing
Browse files Browse the repository at this point in the history
When user preferences file did not exist, fatbuildrctl crashed due to
UserPreferences.tokens_dir attribute not being defined. It is fixed by
setting the default value before file existence test.

Fix #130
  • Loading branch information
rezib committed Jul 26, 2023
1 parent efc991c commit 611305a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
are not defined due to error during view matching (#126).
- Fix retrieval of instances list in DBus and fatbuildrweb when default instance
is not defined (#127).
- Fix fatbuildrctl crash when user preferences file is missing (#130).

## [2.0.0] - 2023-05-05

Expand Down
1 change: 1 addition & 0 deletions fatbuildr/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(self, path):
self.uri = None
self.basedir = None
self.message = None
self.tokens_dir = default_user_tokens_dir()

if not path.expanduser().exists():
logger.debug(
Expand Down

0 comments on commit 611305a

Please sign in to comment.