check for nil
This commit is contained in:
parent
246efbdaa8
commit
5a4157c563
|
|
@ -673,9 +673,11 @@ module JamRuby
|
|||
OnlinePresence.delete_all(["user_id = ?", self.id])
|
||||
end
|
||||
|
||||
online_presences.each do |op|
|
||||
new_presence = OnlinePresence.create(self, op, false)
|
||||
self.online_presences << new_presence
|
||||
unless online_presences.nil?
|
||||
online_presences.each do |op|
|
||||
new_presence = OnlinePresence.create(self, op, false)
|
||||
self.online_presences << new_presence
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -684,9 +686,11 @@ module JamRuby
|
|||
PerformanceSample.delete_all(["user_id = ?", self.id])
|
||||
end
|
||||
|
||||
performance_samples.each do |ps|
|
||||
new_sample = PerformanceSample.create(self, ps, false)
|
||||
self.performance_samples << new_sample
|
||||
unless performance_samples.nil?
|
||||
performance_samples.each do |ps|
|
||||
new_sample = PerformanceSample.create(self, ps, false)
|
||||
self.performance_samples << new_sample
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue