I am getting the following nullpointer exception in my code:
fieldName = "created";
Date startDate;
DateFormat df = new SimpleDateFormat(this.dtFormatShort);
startDate = df.parse(doc.getCreated().getDateOnly() + " " + doc.getCreated().getTimeOnly()); //here I get the error
customer.setCreated(startDate);
I am using similar code across my app but there I do not nullpointer exceptions.
is the error related that I am not calling the constructor for the Date object first? and why does the exception not occur on other places of my app?