mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
Merge pull request #2877 from 847689421/v5-dev
修复DateUtil.date(java.time.temporal.TemporalAccessor)方法入参为null时报NullPointerException异常问题,调整为入参为null时return null
This commit is contained in:
commit
c64b38244b
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user