Merge pull request #2877 from 847689421/v5-dev

修复DateUtil.date(java.time.temporal.TemporalAccessor)方法入参为null时报NullPointerException异常问题,调整为入参为null时return null
This commit is contained in:
Golden Looly 2023-02-09 20:06:20 +08:00 committed by GitHub
commit c64b38244b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,6 +121,9 @@ public class DateUtil extends CalendarUtil {
* @since 5.0.0
*/
public static DateTime date(TemporalAccessor temporalAccessor) {
if (temporalAccessor == null) {
return null;
}
return new DateTime(temporalAccessor);
}