This change stablizes the query with DmsfLink objects since they could have stored a project_id of -1 causing a nil error. This may happen when the linking of a dms document with an issue was not successful or aborted as observed with https://github.com/danmunn/redmine_dmsf/pull/1466.