Don't add price_db to sources if it doesn't exist

This commit is contained in:
John Wiegley 2009-10-31 04:15:29 -04:00
parent e1c419b6be
commit a0a980b9f4

View file

@ -146,9 +146,11 @@ std::size_t session_t::read_data(const string& master_account)
cache->should_load(HANDLER(file_).data_files) &&
cache->load(journal))) {
if (price_db_path) {
if (exists(*price_db_path) && read_journal(*price_db_path) > 0)
throw_(parse_error, _("Transactions not allowed in price history file"));
journal->sources.push_back(journal_t::fileinfo_t(*price_db_path));
if (exists(*price_db_path)) {
if (read_journal(*price_db_path) > 0)
throw_(parse_error, _("Transactions not allowed in price history file"));
journal->sources.push_back(journal_t::fileinfo_t(*price_db_path));
}
HANDLER(file_).data_files.remove(*price_db_path);
}