Skip to content

Commit

Permalink
Ensure GetHTTPSURL only called once level_db_ is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
bbondy committed Aug 31, 2018
1 parent 0532a57 commit 259af5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/brave_shields/browser/https_everywhere_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ void HTTPSEverywhereService::InitDB(const base::FilePath& install_dir) {
unzipped_level_db_path.AsUTF8Unsafe(),
&level_db_);
if (!status.ok() || !level_db_) {
level_db_ = nullptr;
LOG(ERROR) << "Level db open error "
<< unzipped_level_db_path.value().c_str()
<< ", error: " << status.ToString();
Expand All @@ -146,7 +147,7 @@ bool HTTPSEverywhereService::GetHTTPSURL(
std::string& new_url) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::AssertBlockingAllowed();
if (!IsInitialized() || url->scheme() == url::kHttpsScheme) {
if (!IsInitialized() || !level_db_ || url->scheme() == url::kHttpsScheme) {
return false;
}
if (!ShouldHTTPSERedirect(request_identifier)) {
Expand Down

0 comments on commit 259af5b

Please sign in to comment.