title: TypeError: Cannot read property '0' of undefined firebase and vuex
body: <p>I'm using vuex action, it happen when I try to get the urlof the uploaded image everything is fine and the image is saved in firebase, but I can't get the downloadUrl and add it the reference of downloadurl to my meetup database </p>
  
  <p>My code look like this</p>
  
  <pre><code>actions: {
      createMeetup ({commit, getters}, payload) {
        const meetup = {
          title: payload.title,
          location: payload.location,
          description: payload.description,
          date: payload.date.toISOString(),
          creatorId: getters.user.id
        }
        let imageUrl
        let key
        firebase.database().ref('meetups').push(meetup)
          .then((data) =&gt; {
            key = data.key
            return key
          })
          .then(key =&gt; {
            const filename = payload.image.name
            const ext = filename.slice(filename.lastIndexOf('.'))
            return firebase.storage().ref('meetups/' + key + '.' + ext).put(payload.image)
          })
          .then(fileData =&gt; {
            console.log(fileData)
            imageUrl = fileData.metadata.downloadURLs[0]
            return firebase.database().ref('meetups').child(key).update({imageUrl: imageUrl})
          })
          .then(() =&gt; {
            commit('createMeetup', {
              ...meetup,
              imageUrl: imageUrl,
              id: key
            })
          })
          .catch((error) =&gt; {
            console.log(error)
          })
      }
  </code></pre>