Adds an extra check in DmsfQuery#dmsf_node
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.
This commit is contained in:
parent
29a3b9231a
commit
d577f559e1
@ -230,7 +230,7 @@ class DmsfQuery < Query
|
||||
dmsf_link = DmsfLink.find_by(id: item.id)
|
||||
if dmsf_link.dmsf_folder
|
||||
!dmsf_link.dmsf_folder.visible? || !DmsfFolder.permissions?(dmsf_link.dmsf_folder, allow_system: false)
|
||||
else
|
||||
elsif dmsf_link.project
|
||||
!dmsf_link.project.dmsf_available?
|
||||
end
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user