title: Cannot read property 'name' of undefined Axios, Vuex
body: <p>In my mounted i call axios to get profile datail, then if success i send payload to 'set_account' vuex.</p>
  
  <p>For recovery this data i use MapGetters (currentAccount) in computed.</p>
  
  <p>When thy recover this data ex: currentAccount.profile.name in console i receive: <code>TypeError: Cannot read property 'name' of undefined</code></p>
  
  <p>But i receive data. Why this error?</p>
  
  <p><a href="https://i.stack.imgur.com/dUx8A.png" rel="nofollow noreferrer">Vuex dev tools image</a></p>
  
  <p>App.vue</p>
  
  <pre><code>&lt;template&gt;
    &lt;!-- Don't drop "q-app" class --&gt;
    &lt;div id="q-app"&gt;
      &lt;q-layout ref="layout"&gt;
    &lt;!-- Header --&gt;
    &lt;q-toolbar slot="header" v-if="this.$route.path !== '/'"&gt;
      &lt;q-btn flat @click="$refs.layout.toggleLeft()"&gt;
        &lt;q-icon name="menu" /&gt;
      &lt;/q-btn&gt;
      &lt;q-toolbar-title&gt;
        Saúde Digital
        &lt;span slot="subtitle"&gt;Meu Perfil&lt;/span&gt;
      &lt;/q-toolbar-title&gt;
    &lt;/q-toolbar&gt;
    &lt;!-- Left Side Panel --&gt;
    &lt;div slot="left"&gt;
      &lt;q-list no-border link inset-separator&gt;
        &lt;q-list-header&gt;
          Olá: {{currentAccount.profile.name}}.
          &lt;q-icon name="sentiment_very_satisfied"/&gt;
        &lt;/q-list-header&gt;
        &lt;q-side-link item to="/docs"&gt;
          &lt;q-item-side icon="link" /&gt;
          &lt;q-item-main label="Link" sublabel="Some menu link" /&gt;
        &lt;/q-side-link&gt;
        &lt;q-item @click="logout"&gt;
          &lt;q-item-side icon="power_settings_new" /&gt;
          &lt;q-item-main label="Logout" /&gt;
        &lt;/q-item&gt;
      &lt;/q-list&gt;
    &lt;/div&gt;
    &lt;!-- sub-routes get injected here: --&gt;
    &lt;router-view /&gt;
    &lt;!-- Footer --&gt;
  
  &lt;/q-layout&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import {http} from 'src/http/index'
  import {mapGetters} from 'vuex'
  
  export default {
    name: 'app',
    beforeMount () {
      this.getProfile()
    },
    computed: {
      ...mapGetters({
        showErros: 'getErrors',
        currentAccount: 'currentAccount'
      })
    },
    methods: {
      getProfile () {
        http.get('profile')
          .then(response =&gt; {
            this.$store.dispatch('set_account', response.data)
          })
          .catch(error =&gt; console.log(error))
      },
      // If not have localStorage token and path not "/" (login)
      // redirect to root (login)
      logout () {
        this.emptyLocalStorage()
        this.$store.dispatch('remove_user')
        this.$router.go('/')
      },
      emptyLocalStorage () {
        delete localStorage.token
      }
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Vuex Store: Auth.js</p>
  
  <pre><code>export default {
    state: {
      account: false,
      errors: false
    },
  
    getters: {
      currentAccount (state) {
        return state.account
      },
      getErrors (state) {
        return state.errors
      }
    },
  
    mutations: {
      LOAD_ERRORS (state, payload) {
        state.errors = payload
      },
      LOAD_ACCOUNT (state, payload) {
        state.account = payload
      },
      REMOVE_ACCOUNT (state, payload) {
        state.account = null
      }
    },
  
    actions: {
      set_errors ({commit}, payload) {
        commit('LOAD_ERRORS', payload)
      },
      set_account ({commit}, payload) {
        commit('LOAD_ACCOUNT', payload)
      },
      remove_account ({commit}) {
        commit('REMOVE_ACCOUNT')
      }
    }
  }
  </code></pre>