mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
修复DateUtil.date(java.time.temporal.TemporalAccessor)方法入参为null时报NullPointerException异常问题,入参为null时return null
This commit is contained in:
parent
4450208e54
commit
aadd768c92
@ -121,6 +121,9 @@ public class DateUtil extends CalendarUtil {
|
|||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
*/
|
*/
|
||||||
public static DateTime date(TemporalAccessor temporalAccessor) {
|
public static DateTime date(TemporalAccessor temporalAccessor) {
|
||||||
|
if (temporalAccessor == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return new DateTime(temporalAccessor);
|
return new DateTime(temporalAccessor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user