summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/members/project_member.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb
index fa04963a1b7..5c167db76b1 100644
--- a/app/models/members/project_member.rb
+++ b/app/models/members/project_member.rb
@@ -14,7 +14,7 @@ class ProjectMember < Member
scope :in_projects, ->(projects) { where(source_id: projects.pluck(:id)) }
scope :with_user, ->(user) { where(user_id: user.id) }
- before_destroy { user.todos.where(project_id: source_id).each(&:destroy) }
+ before_destroy { user.todos.where(project_id: source_id).each(&:destroy) if user }
class << self