Avoid array_intersect error if argv is not defined (#4751)

Credit to @ChVuagniaux. Can be triggered when attempting to run Laravel HTTP tests on OctoberCMS (https://laravel.com/docs/6.x/http-tests)
This commit is contained in:
Christophe Vuagniaux 2019-11-10 17:52:36 +01:00 committed by Luke Towers
parent 615c4cdb04
commit f0db465f46

View File

@ -153,7 +153,7 @@ class ServiceProvider extends ModuleServiceProvider
/*
* CLI
*/
if (App::runningInConsole() && count(array_intersect($commands, Request::server('argv'))) > 0) {
if (App::runningInConsole() && count(array_intersect($commands, Request::server('argv', []))) > 0) {
PluginManager::$noInit = true;
}
}