summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Bot/Games/Game.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Bot/Games/Game.pm b/lib/Bot/Games/Game.pm
index 088a906..c8641a4 100644
--- a/lib/Bot/Games/Game.pm
+++ b/lib/Bot/Games/Game.pm
@@ -53,7 +53,11 @@ has last_turn_time => (
is => 'rw',
isa => 'DateTime',
command => 1,
- formatter => sub { _diff_from_now(shift) },
+ formatter => sub {
+ my $time = shift;
+ return "Nobody has taken a turn yet!" if !$time;
+ return _diff_from_now($time)
+ },
);
has is_active => (