User cards for anonymous visitors immediately dissappear with "500 Internal Server Error" in `card.json?include_post_count_for`

Hmm, thanks for that, looks like you right, it was due to this plugin:

Pinging @pfaffman

Message (184 copies reported)

NoMethodError (undefined method `in_any_groups?' for nil:NilClass)
lib/plugin/instance.rb:301:in `public_send'
lib/plugin/instance.rb:301:in `block (2 levels) in add_to_class'
app/serializers/user_card_serializer.rb:144:in `can_send_private_message_to_user'
(eval):18:in `_fast_attributes'
app/controllers/application_controller.rb:545:in `render_json_dump'
app/controllers/users_controller.rb:147:in `block (2 levels) in show'
app/controllers/users_controller.rb:140:in `show'
app/controllers/users_controller.rb:152:in `show_card'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:367:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'

Backtrace

plugins/discourse-allow-pm-to-staff/plugin.rb:52:in `block (2 levels) in activate!'
lib/plugin/instance.rb:301:in `public_send'
lib/plugin/instance.rb:301:in `block (2 levels) in add_to_class'
app/serializers/user_card_serializer.rb:144:in `can_send_private_message_to_user'
(eval):18:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in `rescue in attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:455:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:343:in `as_json'
2 Likes