<commit_before>package safe

import (
	"github.com/bndw/pick/errors"
)

func (s *Safe) Add(name, username, password string) (*Account, error) {
	if _, exists := s.Accounts[name]; exists {
		return nil, &errors.AccountExists{}
	}

	account := NewAccount(name, username, password)
	s.Accounts[name] = account

	if err := s.save(); err != nil {
		return nil, err
	}

	return &account, nil
}
<commit_msg>Fix issue when generating a new password for an already existing account.<commit_after>package safe

import (
	"github.com/bndw/pick/errors"
)

func (s *Safe) Add(name, username, password string) (*Account, error) {
	if _, exists := s.Accounts[name]; exists {
		account := s.Accounts[name]
		return &account, &errors.AccountExists{}
	}

	account := NewAccount(name, username, password)
	s.Accounts[name] = account

	if err := s.save(); err != nil {
		return nil, err
	}

	return &account, nil
}

{'fraction_non_alphanumeric': 0.1441340782122905, 'fraction_numerical': 0.0, 'mean_word_length': 4.239766081871345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5238215', 'n_tokens_mistral': 313, 'n_tokens_neox': 301, 'n_words': 87}