<commit_before>import { Component, Input, Inject, OnInit, Output, EventEmitter } from '@angular/core';
import { AudioSong } from '../../../models/PlayerStatus';
import { WagerService } from '../../services/wager.service';
import { MyBet } from '../../../models/Bet';

@Component({
  selector: 'app-bet-list',
  templateUrl: './bet-list.component.html',
  styleUrls: ['./bet-list.component.css']
})
export class BetListComponent implements OnInit {

  @Output() onLike = new EventEmitter<AudioSong>();

  @Input() myBets: Array<MyBet>;

  wagerService: WagerService;

  constructor(@Inject(WagerService) _wagerService: WagerService) {
    this.wagerService = _wagerService;
    this.myBets = new Array<MyBet>();
  }

  ngOnInit() {
    this.wagerService.getRoundNumber().subscribe(num => {
      this.myBets = JSON.parse(localStorage.getItem('myBets')).filter(bet => {
        return bet.endRound >= num.toNumber();
      });
    });
  }
}<commit_msg>fix(bet-list): error when no bets exist<commit_after>import { Component, Input, Inject, OnInit, Output, EventEmitter } from '@angular/core';
import { AudioSong } from '../../../models/PlayerStatus';
import { WagerService } from '../../services/wager.service';
import { MyBet } from '../../../models/Bet';

@Component({
  selector: 'app-bet-list',
  templateUrl: './bet-list.component.html',
  styleUrls: ['./bet-list.component.css']
})
export class BetListComponent implements OnInit {

  @Output() onLike = new EventEmitter<AudioSong>();

  @Input() myBets: Array<MyBet>;

  wagerService: WagerService;

  constructor( @Inject(WagerService) _wagerService: WagerService) {
    this.wagerService = _wagerService;
    this.myBets = new Array<MyBet>();
  }

  ngOnInit() {
    this.wagerService.getRoundNumber().subscribe(num => {
      const myBets = localStorage.getItem('myBets');
      if (myBets) {
        this.myBets = JSON.parse(myBets).filter(bet => bet.endRound >= num.toNumber());
      }
    });
  }
}
{'fraction_non_alphanumeric': 0.1739795918367347, 'fraction_numerical': 0.0, 'mean_word_length': 3.7712895377128954, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2392179', 'n_tokens_mistral': 633, 'n_tokens_neox': 633, 'n_words': 124}