diff --git a/src/Illuminate/Support/Manager.php b/src/Illuminate/Support/Manager.php index 592776c2c859..e91268d530f9 100755 --- a/src/Illuminate/Support/Manager.php +++ b/src/Illuminate/Support/Manager.php @@ -56,6 +56,10 @@ public function driver($driver = null) { $driver = $driver ?: $this->getDefaultDriver(); + if (is_null($driver)) { + throw new InvalidArgumentException("Unable to resolve NULL driver for ".get_called_class()); + } + // If the given driver has not been created before, we will create the instances // here and cache it so we can return it next time very quickly. If there is // already a driver created by this name, we'll just return that instance. diff --git a/tests/Integration/Support/Fixtures/NullableManager.php b/tests/Integration/Support/Fixtures/NullableManager.php new file mode 100644 index 000000000000..09e3608ce73b --- /dev/null +++ b/tests/Integration/Support/Fixtures/NullableManager.php @@ -0,0 +1,18 @@ +app))->driver(); + } +}