Rescue from `RecordNotFound` in RedactorFilter
This commit is contained in:
parent
1ec68ea9c2
commit
8db4628b8a
|
@ -35,12 +35,16 @@ module Gitlab
|
||||||
group = Group.find(id)
|
group = Group.find(id)
|
||||||
|
|
||||||
group && can?(:read_group, group)
|
group && can?(:read_group, group)
|
||||||
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_can_reference_project?(id)
|
def user_can_reference_project?(id)
|
||||||
project = Project.find(id)
|
project = Project.find(id)
|
||||||
|
|
||||||
project && can?(:read_project, project)
|
project && can?(:read_project, project)
|
||||||
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_can_reference_user?(id)
|
def user_can_reference_user?(id)
|
||||||
|
|
Loading…
Reference in New Issue