Clojure

rand-nth throws on empty list

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

rand-nth throws when given an empty list.

Solution is to either call seq on parameter, or to supply nil as a not-found parameter in call to nth. Patch fir latter fix included.

Activity

Hide
Andy Fingerhut added a comment -

Changing Patch attribute to value "Code", since I've been told that is what it ought to be for a ticket with a patch ready for screening.

Show
Andy Fingerhut added a comment - Changing Patch attribute to value "Code", since I've been told that is what it ought to be for a ticket with a patch ready for screening.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: