Validate package instance before checking execution policy
This commit is contained in:
parent
41947069be
commit
544d4ebdf6
2 changed files with 9 additions and 6 deletions
|
@ -94,14 +94,14 @@
|
|||
throw new InvalidArgumentException(sprintf('Package %s is not imported', $package));
|
||||
}
|
||||
|
||||
if(self::$imported_packages[$package]?->getMetadata()?->getMainExecutionPolicy() === null)
|
||||
{
|
||||
Console::out('The package does not have a main execution policy, skipping execution');
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(self::$imported_packages[$package] instanceof PackageReader)
|
||||
{
|
||||
if(self::$imported_packages[$package]?->getMetadata()?->getMainExecutionPolicy() === null)
|
||||
{
|
||||
Console::out('The package does not have a main execution policy, skipping execution');
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ExecutionUnitRunner::executeFromPackage(
|
||||
self::$imported_packages[$package],
|
||||
self::$imported_packages[$package]->getMetadata()->getMainExecutionPolicy()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue