avoid access to first element of empty vector

Change-Id: I20a56d6076b78f9b634651ad4328126bf438e155