fix: don't try to init mmap on missing asar (#24890)

This commit is contained in:
Shelley Vohr 2020-08-10 08:22:49 -07:00 committed by GitHub
parent a9eaebb7f4
commit 8311078a96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,7 +119,7 @@ bool FillFileInfoWithNode(Archive::FileInfo* info,
Archive::Archive(const base::FilePath& path) : path_(path) { Archive::Archive(const base::FilePath& path) : path_(path) {
base::ThreadRestrictions::ScopedAllowIO allow_io; base::ThreadRestrictions::ScopedAllowIO allow_io;
if (!file_.Initialize(path_)) { if (base::PathExists(path_) && !file_.Initialize(path_)) {
LOG(ERROR) << "Failed to open ASAR archive at '" << path_.value() << "'"; LOG(ERROR) << "Failed to open ASAR archive at '" << path_.value() << "'";
} }
} }