title: Read from real time database not working Firebase
body: <p>I'm trying to display my username from my Realtime Database but I get this error in my console:</p>
  <blockquote>
  <p>TypeError: Cannot read properties of null (reading 'studioName')
  at studiodash.js:24:71</p>
  </blockquote>
  <p>I'm not really sure what the issue is. I made sure that my info matched up to what I have in my database. I'd really appreciate it if someone could help me solve this problem. I have provided a screenshot of my database setup and my code. Thanks!</p>
  <p>FB Database:</p>
  <p><a href="https://i.stack.imgur.com/tPUPR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tPUPR.png" alt="enter image description here" /></a></p>
  <p>JS:</p>
  <pre><code>
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
  
  // Initialize variables
  const auth = firebase.auth();
  const database = firebase.database();
  
  //Check if user is signed in and their display info
  firebase.auth().onAuthStateChanged( function(user) {
    if (user) {
      database.ref('/studiopick/studio/users/' + user.uid).get().then(snapshot =&gt;{
        document.getElementById
        (&quot;studioName&quot;).innerText = snapshot.val().studioName;
        (&quot;profile-name&quot;).innerText = snapshot.val().studioName;
  
  
      }).catch(e =&gt; {console.log(e)})
    } else {
      window.location.href =&quot;login.html?error&quot;;
      alert(&quot;No active user please sign or sign up.&quot;);
    }
  }); 
  
  
  
  </code></pre>
  <p>HTML</p>
  <pre><code>&lt;!---Edit Profile---&gt;
        &lt;div class=&quot;edit-profile&quot; id=&quot;edit-profile&quot;&gt;
          &lt;div class=&quot;card-body&quot;&gt;
            &lt;form id=&quot;studioForm&quot;&gt;
              &lt;h5 class=&quot;card-title text-muted&quot;&gt;&lt;strong&gt;Edit Profile&lt;/strong&gt;&lt;/h5&gt;
              &lt;p class=&quot;profile-title&quot; id=&quot;studioName&quot;&gt;&lt;b&gt;Enter Studio Name&lt;/b&gt;&lt;/p&gt;
              &lt;p class=&quot;profile-location&quot; id=&quot;profile-location&quot;&gt;Bethesda, MD&lt;/p&gt;
              &lt;img class=&quot;star&quot; src=&quot;Images/Star.png&quot;&gt;
              &lt;p class=&quot;profile-rating&quot; id=&quot;profile-rating&quot;&gt;4.25&lt;/p&gt;
              &lt;p class=&quot;profile-reviews&quot; id=&quot;profile-reviews&quot;&gt;8 reviews&lt;/p&gt;
              
              &lt;img class=&quot;card-img-bottom&quot; id=&quot;profile-image&quot; src=&quot;Images/placeholder.png&quot;&gt;
  
              &lt;button type=&quot;button&quot; id=&quot;editprofilebutton&quot; onclick=&quot;window.location.href='editprofile.html'&quot;&gt;Edit Profile&lt;/button&gt;
            &lt;/form&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;!---Edit Profile---&gt;
  
  
  </code></pre>