mirror of https://github.com/kiwix/libkiwix.git
Noted a potential bug in Library::addBook()
This commit is contained in:
parent
ad2eb52553
commit
1d5383435d
|
@ -108,7 +108,9 @@ bool Library::addBook(const Book& book)
|
||||||
if ( ! booksReferToTheSameArchive(oldbook, book) ) {
|
if ( ! booksReferToTheSameArchive(oldbook, book) ) {
|
||||||
dropReader(book.getId());
|
dropReader(book.getId());
|
||||||
}
|
}
|
||||||
oldbook.update(book);
|
oldbook.update(book); // XXX: This may have no effect if oldbook is readonly
|
||||||
|
// XXX: Then m_bookDB will become out-of-sync with
|
||||||
|
// XXX: the real contents of the library.
|
||||||
return false;
|
return false;
|
||||||
} catch (std::out_of_range&) {
|
} catch (std::out_of_range&) {
|
||||||
m_books[book.getId()] = book;
|
m_books[book.getId()] = book;
|
||||||
|
|
Loading…
Reference in New Issue