Added null list checking before enumerating.