Commit a89c590f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Prevent exceptions for methods like ProjectTeam#developer? if no membership exists

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c283fba3
...@@ -118,19 +118,19 @@ class ProjectTeam ...@@ -118,19 +118,19 @@ class ProjectTeam
end end
def guest?(user) def guest?(user)
find_tm(user.id).access_field == Gitlab::Access::GUEST find_tm(user.id).try(:access_field) == Gitlab::Access::GUEST
end end
def reporter?(user) def reporter?(user)
find_tm(user.id).access_field == Gitlab::Access::REPORTER find_tm(user.id).try(:access_field) == Gitlab::Access::REPORTER
end end
def developer?(user) def developer?(user)
find_tm(user.id).access_field == Gitlab::Access::DEVELOPER find_tm(user.id).try(:access_field) == Gitlab::Access::DEVELOPER
end end
def master?(user) def master?(user)
find_tm(user.id).access_field == Gitlab::Access::MASTER find_tm(user.id).try(:access_field) == Gitlab::Access::MASTER
end end
private private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment