Permalink
Browse files

Test if defined planet returned in search.

  • Loading branch information...
1 parent 59d8947 commit 5fc57a58942977f2b99bbc7e0cb7da525fa8fae0 @lemming552 lemming552 committed Mar 10, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/Lacuna/DB/Result/Empire.pm
@@ -676,6 +676,7 @@ sub find_home_planet {
my $home_planet;
while (scalar @possible_planets > 0) {
my $planet = splice (@possible_planets, randint(0,scalar @possible_planets), 1);
+ next unless (defined($planet));
# skip planets with member's only colonization
next if ($planet->empire); # If a planet is qualified, but inhabited.
if ($planet->star->station_id) {

0 comments on commit 5fc57a5

Please sign in to comment.