diff --git a/rules.module b/rules.module
index 3a983aa..4b5b2dc 100644
--- a/rules.module
+++ b/rules.module
@@ -1187,6 +1187,9 @@ function rules_drupal_goto_alter(&$path, &$options, &$http_response_code) {
  * Returns whether the debug log should be shown.
  */
 function rules_show_debug_output() {
+  if (!function_exists('user_access')) {
+    return FALSE;
+  }
   if (variable_get('rules_debug', FALSE) == RulesLog::INFO && user_access('access rules debug')) {
     return TRUE;
   }
