silverstripe/silverstripe-framework — pull request #2293 by robert-h-curry (2013-08-05 03:50:36+00:00)
Title: Preempt fatal errors when making some function calls on an empty ArrayList

The function "first" on ArrayList uses the PHP function "reset", which
returns false if there aren't any elements in the array. Two functions
inside ArrayList use this function, "canFilterBy" and "byID". I've
changed these functions to catch the possibility of a false return from
first().

Also change first() and last() to return null in the case of an empty list, instead of false?