Your Date object is null. The implementation of setTime() is:

public final void setTime(Date date) {
        setTimeInMillis(date.getTime());
}

Since it is crashing with a NullPointerException in this method, date
must be null.

On Fri, Apr 22, 2011 at 11:41 AM, Jake Colman <[email protected]> wrote:
>
> I have been getting ACRA crash reports with the following stacktrace:
>
> java.lang.NullPointerException
> at java.util.Calendar.setTime(Calendar.java:1284)
> at java.text.SimpleDateFormat.formatImpl(SimpleDateFormat.java:730)
> at java.text.SimpleDateFormat.format(SimpleDateFormat.java:1011)
> at java.text.DateFormat.format(DateFormat.java:384)
> at com.jnc.zmanminder.ZMUpdateService.buildUpdate(ZMUpdateService.java:117)
>
> The code that triggers this crash is as follows:
>
> ZmanimCalendar c = new ZmanimCalendar(l);
> Date SunsetTime = c.getSunset();
> String SunsetTimeString =
>   DateFormat.getTimeInstance(DateFormat.SHORT).format(SunsetTime);
>
> What could possibly trigger an NPE in this code?  Is there something I
> should be checking about SunsetTime before passing it in to be
> formatted?
>
> --
> Jake Colman -- Android Tinkerer
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in NYC: http://marakana.com/training/android/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to