lib/sportradar/api/football/play_statistics.rb in sportradar-api-0.11.28 vs lib/sportradar/api/football/play_statistics.rb in sportradar-api-0.11.29
- old
+ new
@@ -17,10 +17,10 @@
end
end
def players
@players ||= [:kick, :return, :rush, :defense, :receive, :punt, :penalty, :pass, :field_goal, :defense, :down_conversion].flat_map do |stat_type|
- Array(send(stat_type)).map { |stat| stat.player.team = stat.team.id; stat.player }
+ Array(send(stat_type)).map { |stat| (stat.player.team = stat.team.id; stat.player) if stat.player }.compact # this is cause of kick returns w/ touchbacks
end
end
def players_by_team
@players_by_team ||= players.group_by(&:team)
\ No newline at end of file