From 2e425408eeb1065eacb4bcded2cc88d05a689e1c Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 23 Sep 2015 11:49:28 +0800 Subject: Bug 1204645 - fix error generated by users who have never logged in --- extensions/BMO/lib/Reports/Groups.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'extensions/BMO/lib/Reports') diff --git a/extensions/BMO/lib/Reports/Groups.pm b/extensions/BMO/lib/Reports/Groups.pm index 87aa14a0c..240feb5cc 100644 --- a/extensions/BMO/lib/Reports/Groups.pm +++ b/extensions/BMO/lib/Reports/Groups.pm @@ -264,8 +264,9 @@ sub _filter_userlist { my ($list, $include_disabled) = @_; $list = [ grep { $_->is_enabled } @$list ] unless $include_disabled; my $now = DateTime->now(); + my $never = DateTime->from_epoch( epoch => 0 ); foreach my $user (@$list) { - my $last_seen = datetime_from($user->last_seen_date); + my $last_seen = datetime_from($user->last_seen_date) // $never; $user->{last_seen_days} = sprintf( '%.0f', $now->subtract_datetime_absolute($last_seen)->delta_seconds / (28 * 60 * 60)); -- cgit v1.2.3-24-g4f1b