Fix crash if duration is null