From 6073f7c2e09fa157a532bd76d41676a523316747 Mon Sep 17 00:00:00 2001
From: rupertj <ru@subhub.com>
Date: Tue, 1 Mar 2011 09:51:36 +0000
Subject: [PATCH] Stopped _registry_check_code causing fatal errors when file isn't there

---
 includes/bootstrap.inc |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index fe1741d..f2cb0f8 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -2680,12 +2680,15 @@ function _registry_check_code($type, $name = NULL) {
   $lookup_cache[$cache_key] = $file;
 
   if ($file) {
-    require_once DRUPAL_ROOT . '/' . $file;
-    return TRUE;
-  }
-  else {
-    return FALSE;
+    $file_fullpath = DRUPAL_ROOT . '/' . $file;
+
+    if (file_exists($file_fullpath)) {
+      require_once $file_fullpath;
+      return TRUE;
+    }
   }
+
+  return FALSE;
 }
 
 /**
-- 
1.7.0.4

