fix index_for_non_list error when fetching subkey from null