diff --git a/activity.module b/activity.module
index 64661db..b2ac222 100644
--- a/activity.module
+++ b/activity.module
@@ -529,7 +529,7 @@ function activity_token_values($type, $object = NULL, $options = array()) {
  * The types that a prepared for the token replace. Generally, the represent $info->objects
  *
  * @param stdClass $activity_object
- * The activity object from the activity_info() hook 
+ * The activity object from the activity_info() hook
  *
  * @return boolean
  * whether or not to record this trigger
@@ -559,11 +559,11 @@ function activity_record_check($object, $context, $token_objects, $activity_obje
   if (isset($context['activity_types'])) {
     $types = array_filter($context['activity_types']);
   }
-  
+
   if (!empty($types)) {
     return module_invoke(activity_module_name($context['hook']), 'activity_type_check', $token_objects, $types);
   }
-  
+
   return TRUE;
 }
 
@@ -592,14 +592,14 @@ function activity_record($object, $context, $a1 = NULL, $a2 = NULL) {
       break;
     }
   }
-  
+
   if (!$activity_object) {
     // not a valid trigger
     return;
   }
-  
+
   $type = $activity_object->object_type;
-  
+
   // bring in all the types so that we can replace_multiple
   foreach ($activity_object->objects as $object_key) {
     if (!empty($context[$object_key])) {
@@ -623,7 +623,7 @@ function activity_record($object, $context, $a1 = NULL, $a2 = NULL) {
   if (empty($objects['user'])) {
     $objects['user'] = user_load($context['actor']);
   }
-  
+
   drupal_alter('activity_objects', $objects, $type);
 
   // check make sure we should record this activity
@@ -680,7 +680,7 @@ function activity_record($object, $context, $a1 = NULL, $a2 = NULL) {
     // because the record hasn't yet been saved to the node table
     $published = $published && $context['node']->status == 1;
   }
-  
+
   // NOTICE: no elseif(). This is because if the comment is part of the context
   // we want that nid as its the lowest level player. Doubt that will ever be an issue
   if (isset($context['comment']->nid)) {
@@ -696,7 +696,7 @@ function activity_record($object, $context, $a1 = NULL, $a2 = NULL) {
   $record->created = $context['created'];
   $record->actions_id = $context['aid'];
   $record->status = ($published) ? 1 : 0;
-  
+
   // handle the entity id
   if (!empty($info->eid_field) && isset($context[$type]->{$info->eid_field})) {
     $record->eid = $context[$type]->{$info->eid_field};
@@ -707,12 +707,18 @@ function activity_record($object, $context, $a1 = NULL, $a2 = NULL) {
 
   // allow other modules to manipulate the record before insertion
   drupal_alter('activity_record', $record, $context);
+
+  // record could be nulled by other modules to avoid tracking
+  if (!isset($record) || empty($record)) {
+    return;
+  }
+
   drupal_write_record('activity', $record);
-  
+
   // allow other modules to change the messages based on the activity type and
   // objects.
   drupal_alter('activity_messages', $messages, $activity_object->name, $objects);
-  
+
   // write the messages here
   foreach ($messages as $language_id => $language_messages) {
     foreach ($language_messages as $uid => $message) {
@@ -720,7 +726,7 @@ function activity_record($object, $context, $a1 = NULL, $a2 = NULL) {
       $message_record = new stdClass();
       $message_record->message = $message;
       drupal_write_record('activity_messages', $message_record);
-      
+
       // now save the target with the amid from above ^^
       $target_record = new stdClass();
       $target_record->aid = $record->aid;
@@ -730,12 +736,12 @@ function activity_record($object, $context, $a1 = NULL, $a2 = NULL) {
       drupal_write_record('activity_targets', $target_record);
     }
   }
-  
+
   // after this is recorded, another module might want the aid
   module_invoke_all('activity_message_recorded', $record, $context);
 
   $grants = activity_get_grants($record);
-  
+
   foreach ($grants as $realm => $values) {
     foreach ($values as $value) {
       // insert one by one. In D7 we can use the DBTNG to insert multiple
@@ -756,7 +762,7 @@ function activity_record($object, $context, $a1 = NULL, $a2 = NULL) {
  *
  * @return array
  * The grant records for this activity
- * 
+ *
  */
 function activity_get_grants($record) {
   // Load up any files that need to be loaded.
@@ -855,7 +861,7 @@ function activity_cron() {
     while ($uid_obj = db_fetch_object($uid_result)) {
       $uids[] = $uid_obj->uid;
     }
-    
+
     if (!empty($uids)) {
       // DELETE where uid IN () ^^ AND a.created < expire
       $args = array_merge($uids, array($_SERVER['REQUEST_TIME'] - $expire));
@@ -1039,7 +1045,7 @@ function theme_activity_token_help($types = array('all'), $prefix = '[', $suffix
       '#value' => theme('table', $headers, $rows, array('class' => 'description')),
     );
   }
-  
+
   return drupal_render($form);
 }
 
