mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Added error when trying to unlock uninitialized vault
This commit is contained in:
parent
48f2ae2154
commit
05ce7086f7
@ -721,6 +721,10 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
// initializing the persisted keyrings to RAM.
|
// initializing the persisted keyrings to RAM.
|
||||||
unlockKeyrings (password) {
|
unlockKeyrings (password) {
|
||||||
const encryptedVault = this.configManager.getVault()
|
const encryptedVault = this.configManager.getVault()
|
||||||
|
if (!encryptedVault) {
|
||||||
|
throw new Error('Cannot unlock without a previous vault.')
|
||||||
|
}
|
||||||
|
|
||||||
return this.encryptor.decrypt(password, encryptedVault)
|
return this.encryptor.decrypt(password, encryptedVault)
|
||||||
.then((vault) => {
|
.then((vault) => {
|
||||||
this.password = password
|
this.password = password
|
||||||
|
Loading…
Reference in New Issue
Block a user