title: If condition after result of Promise
body: <p>I have a problem with a promise. I have this function that is used to comunicate with Firestore database:</p>
  <pre><code>  async getDataFromDB() {
      const junctionRef = firebase
        .firestore()
        .collection('junction')
        .doc(this.id)
        .collection('items')
        .doc(this.userId);
      return await junctionRef.get().then((doc) =&gt; {
        const details = doc.data();
        return details;
      });
    }
  </code></pre>
  <p>In ngOnInit method I call this funtion and, based on the result of this promise, I want to set some values:</p>
  <pre><code>  ngOnInit() {
      ....
      this.getDataFromDB().then((data) =&gt; {
        if(data != null &amp;&amp; data.numbers&lt;10 )
          // TO SOMETHING
      });
  </code></pre>
  <p>But it never enters the if because data tells me it is undefined . How can I solve it ?</p>