Fixed error with getting primary key from none object item.