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
|
@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
This update introduces critical bug fixes
|
This update introduces critical bug fixes
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Validate package instance before checking execution policy
|
||||||
|
|
||||||
|
|
||||||
## [2.1.5] - 2024-10-14
|
## [2.1.5] - 2024-10-14
|
||||||
|
|
||||||
|
|
|
@ -94,14 +94,14 @@
|
||||||
throw new InvalidArgumentException(sprintf('Package %s is not imported', $package));
|
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] 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(
|
return ExecutionUnitRunner::executeFromPackage(
|
||||||
self::$imported_packages[$package],
|
self::$imported_packages[$package],
|
||||||
self::$imported_packages[$package]->getMetadata()->getMainExecutionPolicy()
|
self::$imported_packages[$package]->getMetadata()->getMainExecutionPolicy()
|
||||||
|
|
Loading…
Add table
Reference in a new issue