fix npe if fetch ref on empty result