From a6b58401b3bef860713f96c1ba5c576bd94e0b10 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 26 Feb 2020 11:25:37 +0000 Subject: Fix error hiding user's updates with no confirmed. If a user had no confirmed updates, but did have e.g. an unconfirmed update that had mark_fixed set, you would get an error when trying to hide the user's reports/updates. --- perllib/FixMyStreet/DB/Result/Comment.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'perllib/FixMyStreet/DB/Result/Comment.pm') diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index bac183271..b217bf96c 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -292,6 +292,7 @@ sub is_latest { { problem_id => $self->problem_id, state => 'confirmed' }, { order_by => [ { -desc => 'confirmed' }, { -desc => 'id' } ] } )->first; + return unless $latest_update; return $latest_update->id == $self->id; } -- cgit v1.2.3