Swifterswift: Collection.randomItem crash with empty collection

Created on 17 Feb 2018  路  2Comments  路  Source: SwifterSwift/SwifterSwift

Collection.random item extension is not handling the empty array case.
Also, the tests for this extensions are in the wrong file (ArrayTests), should be in the CollectionExtensionsTests.

source unit tests

Most helpful comment

Issue 404 handles non-existent cases in a Collection 馃槀.

All 2 comments

Whoever fixes this, make sure they add a test to handle the empty case 馃槄

Issue 404 handles non-existent cases in a Collection 馃槀.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AYastrebov picture AYastrebov  路  3Comments

g001613001 picture g001613001  路  5Comments

marcocapano picture marcocapano  路  5Comments

SD10 picture SD10  路  3Comments

omaralbeik picture omaralbeik  路  5Comments