Index: stormorganization.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/storm/stormorganization/stormorganization.module,v
retrieving revision 1.11.4.27
diff -u -r1.11.4.27 stormorganization.module
--- stormorganization.module   1 Jun 2009 00:22:40 -0000   1.11.4.27
+++ stormorganization.module   3 Jun 2009 15:54:55 -0000
@@ -123,7 +123,14 @@
       $cond .= "${primary_table}.uid=". $account->uid;
     }
     if (user_access('Storm organization: view belonged', $account)) {
-      if ($cond) $cond .= ' OR ';
+      if ($cond) {
+        $cond .= ' OR ';
+      }
+      // If function is called without viewing an organization, this variable may not be set.
+      // These lines check for that and set the organization node id to zero if not otherwise set.
+      if (!isset($account->stormorganization_nid)) {
+        $account->stormorganization_nid = 0;
+      }
       $cond .= ' sor1.nid='. $account->stormorganization_nid;
     }
     if ($cond) {
