title: java NullPointerException when selecting items in a JList
body: <p>I cannot, for the life of me, figure out what is wrong with my JList. I have a DefaultListModel object containing a custom data type which is populated from a HashMap of those objects. Everything works fine until there are 16 or more objects in the group. Here is what happens:</p>
  
  <p><img src="https://i.stack.imgur.com/fzcAL.jpg" alt="01">
  <img src="https://i.stack.imgur.com/G0Kjq.jpg" alt="02">
  <img src="https://s21.postimg.org/ug11z7ucn/HDHR3_PVR_03.jpg" alt="03">
  <img src="https://s21.postimg.org/eyi599d9j/HDHR3_PVR_04.jpg" alt="04">
  <img src="https://s21.postimg.org/fcjh8uxd3/HDHR3_PVR_05.jpg" alt="05"></p>
  
  <p>As you can tell, there are suddenly empty spaces in the list, even though the HashMap it is populating from doesn't have any null objects. Also, here is the code used to populate the JList:</p>
  
  <pre><code>for(Entry&lt;Integer, TV_Season_v2&gt; e : rc.shows.get(index).seasons.entrySet()){
      seasonslistmodel.addElement(e.getValue());
  }
  </code></pre>
  
  <p>and here is the line which gives a null pointer exception:</p>
  
  <pre><code>int mapSeasonIndex = seasonsList.getSelectedValue().getSeasonNum();
  </code></pre>
  
  <p>What is going on?</p>