diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index dcab7df..4df719c 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -1685,6 +1685,12 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
 
   static $in_error_state = FALSE;
 
+  // Ensure that $variables is in the correct format.
+  if (isset($variables) && !is_array($variables)) {
+    watchdog('system', 'Log message was generated with an incorrect variable list passed to the watchdog() function (must be an array or NULL). Message type: %type, message text: %message.', array('%type' => $type, '%message' => $message), WATCHDOG_ERROR);
+    $variables = array();
+  }
+
   // It is possible that the error handling will itself trigger an error. In that case, we could
   // end up in an infinite loop. To avoid that, we implement a simple static semaphore.
   if (!$in_error_state && function_exists('module_implements')) {
