more safe check for querying linked document in view output

also not crashing, ftw