For JIRA issue NIHVIVO-4026, checking query model resource is not null before accessing it