2

Resolved

null reference of HttpContext.Current.Session

description

Maybe because I have session disabled (or some other reason), but I came across an exception in FacebookHttpRequest.cs line 55:
 
if (HttpContext.Current.Items[KEY_FBREQUEST] == null && HttpContext.Current.Session[KEY_FBREQUEST] != null)
 
My local fix (which seems generally safer in this case anyways) was to change that line to
 
if (HttpContext.Current.Items[KEY_FBREQUEST] == null && HttpContext.Current.Session != null && HttpContext.Current.Session[KEY_FBREQUEST] != null)
 
I hope this helps. Thanks.

comments

DanielSchaffer wrote May 13, 2009 at 4:36 AM

I like it!

wrote May 13, 2009 at 4:36 AM

wrote May 13, 2009 at 4:37 AM

wrote May 13, 2009 at 1:48 PM

DanielSchaffer wrote May 13, 2009 at 3:24 PM

This change is available in the latest changeset in source control.

wrote Aug 3, 2009 at 2:49 PM

wrote Feb 14, 2013 at 7:50 PM

wrote May 16, 2013 at 9:55 AM

wrote May 16, 2013 at 9:55 AM

wrote Jun 14, 2013 at 7:15 AM