diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 19644a624..78522d1ed 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -119,7 +119,7 @@ class WechatsController < ActionController::Base on :click, with: 'MY_NEWS' do |request, key| uw = user_binded?(request[:FromUserName]) - if uw + if uw && uw.user ua = UserActivity.where(user_id: uw.user.id).order("id desc").limit(5) news = ua.map do |ua| {title: "act_type: #{ua.act_type}, act_id: #{ua.act_id}", content: "container_id: #{ua.container_id}, container_type: #{ua.container_type}"}