Or even better: use appropriate guards to ensure that .Random is never called if locations is empty.