Safe returning nil on randomObject when is empty

Implemented the same way it's implemented on firstObject.