mirror of https://github.com/kiwix/libkiwix.git
fix open external zim
Check if the parameter `pathToSave` is empty before use it otherwise the book path is empty too, which causes crash on opening external zim files
This commit is contained in:
parent
8fc42558d3
commit
0586ef6d41
|
@ -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),
|
||||||
|
|
Loading…
Reference in New Issue