mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 21:07:21 +01:00
verify hash length on loading of file cache db
This commit is contained in:
parent
4ef2054995
commit
fff40f579f
1 changed files with 3 additions and 2 deletions
|
|
@ -60,13 +60,14 @@ public sealed class FileCacheManager : IDisposable
|
|||
try
|
||||
{
|
||||
var hash = splittedEntry[0];
|
||||
if (hash.Length != 40) throw new InvalidOperationException("Expected Hash length of 40, received " + hash.Length);
|
||||
var path = splittedEntry[1];
|
||||
var time = splittedEntry[2];
|
||||
AddHashedFile(ReplacePathPrefixes(new FileCacheEntity(hash, path, time)));
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning("Failed to initialize entry {entry}, ignoring", entry);
|
||||
_logger.LogWarning(ex, "Failed to initialize entry {entry}, ignoring", entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue