? masquerade-987610.patch
Index: masquerade.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/masquerade/masquerade.module,v
retrieving revision 1.16.2.49
diff -u -p -r1.16.2.49 masquerade.module
--- masquerade.module	1 Nov 2010 02:09:01 -0000	1.16.2.49
+++ masquerade.module	2 Dec 2010 22:28:14 -0000
@@ -41,7 +41,9 @@ function masquerade_init() {
   // $uid === 0 we want to store the session variable. If there's no record in
   // masquerade table we clear the session variable.
   if ($uid === FALSE) {
-    unset($_SESSION['masquerading']);
+    if (isset($_SESSION)) {
+      unset($_SESSION['masquerading']);
+    }
   }
   else {
     $_SESSION['masquerading'] = $uid;
