|
@@ -10,8 +10,22 @@ class EmailList extends React.Component {
|
|
|
const player = players.find(player =>
|
|
|
(player.name === match.Spieler1) && (player.Konkurrenz === match.Konkurrenz)
|
|
|
)
|
|
|
- if (!emailList.includes(player.Email)) {
|
|
|
- emailList.push(player.Email)
|
|
|
+ if (!player) {
|
|
|
+ console.log('EmailList: Player not found!', player, key, match)
|
|
|
+ } else {
|
|
|
+ if (!emailList.includes(player.Email)) {
|
|
|
+ emailList.push(player.Email)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const player2 = players.find(player =>
|
|
|
+ (player.name === match.Spieler1) && (player.Konkurrenz === match.Konkurrenz)
|
|
|
+ )
|
|
|
+ if (!player2) {
|
|
|
+ console.log('EmailList: Player not found!', player2, key, match)
|
|
|
+ } else {
|
|
|
+ if (!emailList.includes(player2.Email)) {
|
|
|
+ emailList.push(player2.Email)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
|