Write a warning if no version was returned from the malware download, causing the malware db not to be cached.

This commit is contained in:
Sander Declerck 2025-11-04 11:26:07 +01:00
parent e79fbded9e
commit 3ea4e82acb
No known key found for this signature in database

View file

@ -75,9 +75,15 @@ async function getMalwareDatabase() {
if (version) { if (version) {
// Only cache the malware database when we have a version. // Only cache the malware database when we have a version.
writeDatabaseToLocalCache(malwareDatabase, version); writeDatabaseToLocalCache(malwareDatabase, version);
}
return malwareDatabase; return malwareDatabase;
} else {
// We received a valid malware database, but the response
// did not contain an etag header with the version
ui.writeWarning(
"The malware database was downloaded, but could not be cached due to a missing version."
);
return malwareDatabase;
}
} catch (/** @type any */ error) { } catch (/** @type any */ error) {
if (cachedDatabase) { if (cachedDatabase) {
ui.writeWarning( ui.writeWarning(