1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Add account type assertion to PreferencesController#setAccountLabel

This commit is contained in:
Whymarrh Whitby 2018-06-05 14:06:56 -07:00
parent c2e3194dbf
commit 3cc85c219e

View File

@ -247,6 +247,7 @@ class PreferencesController {
* @return {Promise<string>}
*/
setAccountLabel (account, label) {
if (!account) throw new Error('setAccountLabel requires a valid address, got ' + String(account))
const address = normalizeAddress(account)
const {identities} = this.store.getState()
identities[address] = identities[address] || {}