FIX: ensures shadow has last_posted_at before comparing to site setting (#10374)

FIX: ensures shadow has last_posted_at before comparing to site setting (#10374)

diff --git a/app/services/anonymous_shadow_creator.rb b/app/services/anonymous_shadow_creator.rb
index c5c4d87..385413f 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

GitHub sha: b6e475a8

This commit appears in #10374 which was approved by davidtaylorhq. It was merged by jjaffeux.