title: Object reference not set to an instance of an object - vb.net
body: <p>I'm trying to get the InnerHtml of a child of a child of an element. Here is what I have:</p>
  
  <pre><code>If doc.GetElementById("ctl00_cphBanner_MenuRedesign_BannerAlertsAndOptionsLoginView_BannerAlertsAndOptions_Authenticated_FriendsBubble") IsNot Nothing Then
                      Dim el As HtmlElement = doc.GetElementById("ctl00_cphBanner_MenuRedesign_BannerAlertsAndOptionsLoginView_BannerAlertsAndOptions_Authenticated_FriendsBubble")
                      inboxTxt.Text = el.Children(1).Children(0).InnerHtml.ToString
                  End If
  </code></pre>
  
  <p>And this is the error I'm receiving:</p>
  
  <pre><code>"Object reference not set to an instance of an object."
  </code></pre>
  
  <p>How do I fix this?</p>
  
  <p>Edit: When I removed the "Try" function, the error was shown here:</p>
  
  <pre><code>If doc.GetElementById("ctl00_cphBanner_MenuRedesign_BannerAlertsAndOptionsLoginView_BannerAlertsAndOptions_Authenticated_FriendsBubble") IsNot Nothing Then
  </code></pre>