diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php
index 5b3f54a..3e2b99d 100644
--- a/system/codeigniter/CodeIgniter.php
+++ b/system/codeigniter/CodeIgniter.php
@@ -125,9 +125,16 @@
require(BASEPATH.'codeigniter/Base5'.EXT);
}
+// Load the base controller class
load_class('Controller', FALSE);
-require(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT);
+// Load the local application controller
+// Note: The Router class automatically validates the controller path. If this include fails it
+// means that the default controller in the Routes.php file is not resolving to something valid.
+if ( ! @include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT))
+{
+ show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.');
+}
// Set a mark point for benchmarking
$BM->mark('loading_time_base_classes_end');