Skip to content

Commit bec67f9

Browse files
committed
ModuleManager: fix error caused by missing dep
1 parent 76f9f60 commit bec67f9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/iTXTech/SimpleFramework/Module/ModuleManager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ private static function sortModule(array $modules) : array{
150150
}
151151
$m = [];
152152
foreach($resolved as $name){
153-
$m[$name] = $modules[$name];
153+
if(isset($modules[$name])){
154+
$m[$name] = $modules[$name];
155+
}
154156
}
155157
return $m;
156158
}

src/iTXTech/SimpleFramework/Util/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public static function getLatestGitCommitId(string $dir) : ?string{
245245

246246
public static function depResolve($item, array $items, array $resolved, array $unresolved){
247247
array_push($unresolved, $item);
248-
foreach($items[$item] as $dep){
248+
foreach($items[$item] ?? [] as $dep){
249249
if(!in_array($dep, $resolved)){
250250
if(!in_array($dep, $unresolved)){
251251
array_push($unresolved, $dep);

0 commit comments

Comments
 (0)