title: error : Unable to perform runtime binding (when location/hometown/any setting is not set in facebook profile)
body: <p>I am facing an error </p>
  
  <p><strong>Cannot perform runtime binding on a null reference</strong></p>
  
  <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
  
  <p>Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference</p>
  
  <p>Source Error:</p>
  
  <p>Line 27:         lblBirthday.Text = (myInfo.birthday == null ? string.Empty : DateTime.Parse(myInfo.birthday).ToString("dd-MMM-yy"));
  Line 28:         lblHometown.Text = (myInfo.hometown.name == null ? string.Empty : myInfo.hometown.name);
  <strong>Line 29:         lblLocation.Text = (myInfo.location.name == null ? string.Empty : myInfo.location.name);</strong>
  Line 30:         pnlHello.Visible = true;
  Line 31:     }</p>
  
  <p>Here is my code :</p>
  
  <pre><code>var fb = new FacebookWebClient();
      dynamic myInfo = fb.Get("me");
      lblName.Text = myInfo.name;
      imgProfile.ImageUrl = "https://graph.facebook.com/" + myInfo.id + "/picture";
      lblBirthday.Text = (myInfo.birthday == null ? string.Empty : DateTime.Parse(myInfo.birthday).ToString("dd-MMM-yy"));
      lblHometown.Text = (myInfo.hometown.name == null ? string.Empty : myInfo.hometown.name);
      lblLocation.Text = (myInfo.location.name == null ? string.Empty : myInfo.location.name);
      pnlHello.Visible = true;
  </code></pre>