ocpsoft / prettytime

Social Style Date and Time Formatting for Java
http://ocpsoft.org/prettytime/
Apache License 2.0
1.29k stars 252 forks source link

Workaround NPE in format(List<Duration>) #233

Closed astatio closed 2 years ago

astatio commented 2 years ago

Transforming the units to String makes them "findable". This is far from being the best approach. Added a throw to format(List) because getting an NPE without any message is not good.

Related to #232

lincolnthree commented 2 years ago

Hey @astatio - Thanks for this PR! At first glance, this does seem a bit odd, but I agree this needs to be fixed. I think this should be merged. I'll include it in the next release when I get a few minutes to cut one! It's on my todo list for the week.

lincolnthree commented 2 years ago

This has been released in PrettyTime 5.0.3.Final -- It may take a few hours for Nexus to sync to central. Thanks again for this PR!