title: exception.getmessage() return null
body: <p>I am having trouble adding an object to a collection.</p>
  
  <p>I encountered a java.lang.NullPointerException when I tried adding an object to a collection.</p>
  
  <p>I tested and checked that redemption which is a RedemptionEntity is not null using the if condition as you can see in the code below. It returned "Not NULL!!!!!!!!!"</p>
  
  <p>I went and google that a java.lang.NullPointerException occurs when you tried adding something that is null into a collection. But in this case, I don't think redemption is null. The System.out.println(ex.getMessage()); return me a null.</p>
  
  <p>How do I resolve this issue? Any help here?</p>
  
  <pre><code>private Collection&lt;RedemptionEntity&gt; redemptionCollection; 
  RedemptionEntity redemption = new RedemptionEntity();
  GiftEntity GIFT = em.find(GiftEntity.class, gift);
  redemption.create(date, 0);
  redemption.setGift(GIFT);
  em.persist(redemption);
  
  if (redemption == null) {
                  System.out.println("NULL!!!!!!!!");
              } else {
                  System.out.println("Not NULL!!!!!!!!");
              }
              try {
                  redemptionCollection.add(redemption); //This line is where the exception occurs...
              } catch (Exception ex) {
                  System.out.println(ex.getMessage());
                  ex.printStackTrace();
              }
  </code></pre>