obsfate: fix obsfate_printer with empty date list

When the list of dates is empty, `min` and `max` would raises a ValueError.
Protect against this case by checking that the date list is not empty.

I didn't add a test because I couldn't find a reproducing test case.
This commit is contained in:
Boris Feld 2017-10-18 15:38:51 +02:00
parent 4b2916f625
commit 3df0c5d74a

View File

@ -822,7 +822,7 @@ def obsfateprinter(successors, markers, ui):
# Date
dates = markersdates(markers)
if verbose:
if dates and verbose:
min_date = min(dates)
max_date = max(dates)