8000 Throw exception before download query if entry is not valid · symfony/symfony@8adabc1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8adabc1

Browse files
Throw exception before download query if entry is not valid
1 parent 72f1d48 commit 8adabc1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/AssetMapper/ImportMap/Resolver/JsDelivrEsmResolver.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ public function downloadPackages(array $importMapEntries, callable $progressCall
161161

162162
foreach ($importMapEntries as $package => $entry) {
163163
$pattern = ImportMapType::CSS === $entry->type ? $this->distUrlCssPattern : $this->distUrlPattern;
164+
if (null === $entry->packageName || null === $entry->version || null === $entry->filePath) {
165+
throw new RuntimeException(sprintf('The package %s cannot be downloaded. "packageName", "version" or "filePath" must be defined.', $entry->importName));
166+
}
164167
$url = sprintf($pattern, $entry->packageName, $entry->version, $entry->filePath);
165168

166169
$responses[$package] = $this->httpClient->request('GET', $url);

0 commit comments

Comments
 (0)
0