title: Null Pointer Exception on SimpleDateFormat parse
body: <p>I am getting date from the calender and converting its format using </p>
  
  <pre><code>    SimpleDateFormat sdf1 = new SimpleDateFormat("MM/dd/yyyy");
      Date date = null;
      try {
          date = sdf1.parse(datevalue);
      } catch (ParseException e) {
          e.printStackTrace();
      }
  
      if(date != null) {
          Date d = new Date(date.getTime());
          SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
          return sdf.format(d);
      }
  
      return "";
  </code></pre>
  
  <p>But I am getting crash on some of devices and for some devices it is working fine.<br>
  I don't know why it is happening on some devices only. </p>
  
  <p>I am getting this in Fabric report:</p>
  
  <pre><code>Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference    
         at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1044)
         at java.text.DateFormat.parse(DateFormat.java:577)
         at com.app.appUtilities.Utilities.convertDateFormat(Utilities.java:34)
  </code></pre>
  
  <p>Please help me out.</p>