Skip to content

Commit

Permalink
Fix trying to use non-existing data. See #1422.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiarn committed Jan 12, 2023
1 parent 1488594 commit d262e40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ajenti-core/aj/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ def load(self):
if os.geteuid() == 0:
os.chmod(self.path, 384) # 0o600
with open(self.path, 'r') as smtp:
self.data = yaml.load(smtp, Loader=yaml.SafeLoader)
self.data = yaml.load(smtp, Loader=yaml.SafeLoader) or {}
# Prevent password leak
self.ensure_structure()
self.data['smtp']['password'] = ''

def save(self, data):
Expand Down

0 comments on commit d262e40

Please sign in to comment.