title: how to handle null value in while retrieving values from session list
body: <p>I'm storing multiple values in session by retrieve &amp; assign values from the session like this :</p>
  
  <pre><code>var imageSessList = (List&lt;string&gt;)Session["ImagesNames"];
  
  if (imageSessList != null)
  {
      string image1 = imageSessList[0];
      string image2 = imageSessList[1];
      string image3 = imageSessList[2];
      string image4 = imageSessList[3];
  }
  </code></pre>
  
  <p>but what if the session contain only 3 values, so while assigning <code>string image4 = imageSessList[3];</code> it throws null error.</p>
  
  <p>how to handle null in such situation.</p>