Add account type assertion to PreferencesController#setAccountLabel

feature/default_network_editable
Whymarrh Whitby 7 years ago
parent c2e3194dbf
commit 3cc85c219e
  1. 1
      app/scripts/controllers/preferences.js

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

Loading…
Cancel
Save