mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-27 21:39:37 +00:00
Non-throwing Book::getDefaultIllustration()
This commit is contained in:
@ -231,6 +231,8 @@ void Book::setPath(const std::string& path)
|
||||
: path;
|
||||
}
|
||||
|
||||
const Book::Illustration Book::missingDefaultIllustration;
|
||||
|
||||
const Book::Illustration& Book::getDefaultIllustration() const
|
||||
{
|
||||
for ( const auto& ilPtr : m_illustrations ) {
|
||||
@ -238,7 +240,7 @@ const Book::Illustration& Book::getDefaultIllustration() const
|
||||
return *ilPtr;
|
||||
}
|
||||
}
|
||||
throw std::runtime_error("No default illustration");
|
||||
return missingDefaultIllustration;
|
||||
}
|
||||
|
||||
const std::string& Book::Illustration::getData() const
|
||||
|
Reference in New Issue
Block a user