From b6e475a8f3839403f67ae2ea5d528f30ae99eb03 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 5 Aug 2020 13:20:51 +0200 Subject: [PATCH] FIX: ensures shadow has last_posted_at before comparing to site setting (#10374) --- app/services/anonymous_shadow_creator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/anonymous_shadow_creator.rb b/app/services/anonymous_shadow_creator.rb index c5c4d873c12..385413feb58 100644 --- a/app/services/anonymous_shadow_creator.rb +++ b/app/services/anonymous_shadow_creator.rb @@ -31,6 +31,7 @@ class AnonymousShadowCreator shadow = user.shadow_user if shadow && (shadow.post_count + shadow.topic_count) > 0 && + shadow.last_posted_at && shadow.last_posted_at < SiteSetting.anonymous_account_duration_minutes.minutes.ago shadow = nil end