From 7b29e6ec269e322743f73e2bac738d7b81e8356a Mon Sep 17 00:00:00 2001
From: ilya <ilya@laptop.(none)>
Date: Mon, 27 Sep 2010 15:50:52 -0700
Subject: [PATCH] checking that a user is logged in before doing fb checking

---
 app/controllers/application_controller.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 46b011a618..8817bc6458 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -40,8 +40,10 @@ class ApplicationController < ActionController::Base
   end
 
   def fb_user_info
-    @access_token = env['warden'].session[:access_token]
-    @logged_in = @access_token.present?
+    if current_user
+      @access_token = env['warden'].session[:access_token]
+      @logged_in = @access_token.present?
+    end
   end
 
 end
-- 
GitLab