Skip to content

Commit 51f5793

Browse files
authored
check for empty paths before calling Finder in ux:icons:lock
1 parent 58b0eb2 commit 51f5793

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Icons/src/Twig/IconFinder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ public function icons(): array
6767
private function templateFiles(LoaderInterface $loader): iterable
6868
{
6969
if ($loader instanceof FilesystemLoader) {
70-
$paths = [];
70+
$paths = $loader->getPaths();
7171
foreach ($loader->getNamespaces() as $namespace) {
7272
$paths = [...$paths, ...$loader->getPaths($namespace)];
7373
}
74-
foreach ((new Finder())->files()->in($paths)->name('*.twig') as $file) {
75-
yield (string) $file;
74+
if ($paths) {
75+
foreach ((new Finder())->files()->in($paths)->name('*.twig') as $file) {
76+
yield (string) $file;
77+
}
7678
}
7779
}
7880

0 commit comments

Comments
 (0)