Permalink
Browse files

coping well with missing games

  • Loading branch information...
1 parent 5f5efbd commit 4c413224f3f2af46cfa34d18828bc740171c1d53 @polettix committed Oct 2, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Narsil/Model/Redis.pm
@@ -143,8 +143,12 @@ sub matches_id_for {
sub games {
my ($self) = @_;
- return map {
- $self->get_game($_)
+ return grep { defined $_ } map {
+ my $game;
+ try {
+ $game = $self->get_game($_)
+ };
+ $game;
} $self->redis()->smembers('games');
} ## end sub games

0 comments on commit 4c41322

Please sign in to comment.