Fix never ending hash issue

This commit is contained in:
Timothy Baldridge 2020-02-22 21:56:18 -07:00
parent 6501fe8ce8
commit fe95e0e52e
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,8 @@
### Changelog
#### Version - 0.9.21.0
* Fix never ending hash issue
#### Version - 0.9.20.0
* Don't reuse HTTP request objects (#532)
* Block popups in the in-app browser (#535)

View File

@ -275,8 +275,7 @@ namespace Wabbajack.Common
hash = null;
if (!File.Exists(hashFile)) return false;
var fi = new FileInfo(hashFile);
if (fi.Length != 20) return false;
if (File.GetSize(hashFile) != 20) return false;
using var fs = File.OpenRead(hashFile);
using var br = new BinaryReader(fs);
@ -284,7 +283,7 @@ namespace Wabbajack.Common
if (version != HashCacheVersion) return false;
var lastModified = br.ReadUInt64();
if (lastModified != fi.LastWriteTimeUtc.AsUnixTime()) return false;
if (lastModified != File.GetLastWriteTimeUtc(file).AsUnixTime()) return false;
hash = BitConverter.GetBytes(br.ReadUInt64()).ToBase64();
return true;
}