From 69906b74f7a27bf29dc967b6800e312207f1110f Mon Sep 17 00:00:00 2001
From: Monica Cellio <cellio@pobox.com>
Date: Thu, 6 Feb 2025 17:55:55 -0500
Subject: [PATCH] rubocop (TIL: I thought the first & would stop the rest of
 the expression on nil)

---
 app/models/community_user.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/models/community_user.rb b/app/models/community_user.rb
index ee9e90fd7..f0a80e60f 100644
--- a/app/models/community_user.rb
+++ b/app/models/community_user.rb
@@ -31,7 +31,7 @@ class CommunityUser < ApplicationRecord
   end
 
   def latest_warning
-    mod_warnings&.order(created_at: 'desc').first.created_at
+    mod_warnings&.order(created_at: 'desc')&.first&.created_at
   end
 
   # Calculation functions for privilege scores
-- 
GitLab