Skip to content

Commit c51a459

Browse files
authored
prevent null cases & fix typo
1 parent d48abff commit c51a459

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/Magento/Framework/Setup/Patch/PatchApplier.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ private function prepareRegistry($moduleName, $patchType)
297297
private function applyPatch(PatchInterface $patch): void
298298
{
299299
$patch->apply();
300-
$this->patchHistory->fixPatch(get_class($schemaPatch));
301-
foreach ($schemaPatch->getAliases() as $patchAlias) {
300+
$this->patchHistory->fixPatch(get_class($patch));
301+
foreach ($patch->getAliases() ?? [] as $patchAlias) {
302302
if (!$this->patchHistory->isApplied($patchAlias)) {
303303
$this->patchHistory->fixPatch($patchAlias);
304304
}
@@ -312,7 +312,7 @@ private function isApplied(PatchInterface $patch): bool
312312
{
313313
$patchIdentity = get_class($patch);
314314
if (!$this->patchHistory->isApplied($patchIdentity)) {
315-
foreach ($patch->getAliases() as $alias) {
315+
foreach ($patch->getAliases() ?? [] as $alias) {
316316
if ($this->patchHistory->isApplied($alias)) {
317317
$this->patchHistory->fixPatch($patchIdentity);
318318
return true;

0 commit comments

Comments
 (0)