ids list can be empty

check empty before get(0)
Merge pull request #37 from ggopcceop/master

check empty before get