Merge pull request #341 from kiwix/fix-addBookFromPathAndGetId

This commit is contained in:
Matthieu Gautier 2020-04-20 15:27:57 +02:00 committed by GitHub
commit 9c101daad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ std::string Manager::addBookFromPathAndGetId(const std::string& pathToOpen,
kiwix::Book book; kiwix::Book book;
if (this->readBookFromPath(pathToOpen, &book)) { if (this->readBookFromPath(pathToOpen, &book)) {
if (pathToSave != pathToOpen) { if (!pathToSave.empty() && pathToSave != pathToOpen) {
book.setPath(isRelativePath(pathToSave) book.setPath(isRelativePath(pathToSave)
? computeAbsolutePath( ? computeAbsolutePath(
removeLastPathElement(writableLibraryPath), removeLastPathElement(writableLibraryPath),