Fix NullPointerException when creating duration in temporal object utilities.