Only skip past empty keyedNodes sets if key exists

Otherwise unkeyed references won't be listed!

Bug: 52427
Change-Id: I8bbce955f584cca046e23d07aab8440f1e733657
Merge "Only skip past empty keyedNodes sets if key exists"