Avoiding referencing elements of an empty vector
Merge pull request #4967

459a2d2 Avoiding referencing elements of an empty vector (ENikS)