Fix an error in Collection->random()

Fix an error on random() if called on an empty collection. Returns null instead.