Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Fix: add nullity check for dateString.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawidMuhammadi committed Jun 17, 2020
1 parent 4b98ef1 commit 3e72a93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/org/apache/fineract/utils/DateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/**
* @author Rajan Maurya
* On 06/07/17.
* On 06/07/17.
*/
public class DateUtils {

Expand Down Expand Up @@ -61,7 +61,8 @@ public static String getDate(String dateString, String inputFormat, String outFo
SimpleDateFormat dateFormat = new SimpleDateFormat(inputFormat, Locale.ENGLISH);
Date date = new Date();
try {
date = dateFormat.parse(dateString);
if (dateString != null)
date = dateFormat.parse(dateString);
} catch (ParseException e) {
Log.d(LOG_TAG, e.getLocalizedMessage());
}
Expand Down

0 comments on commit 3e72a93

Please sign in to comment.