mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-23 03:32:13 -04:00
Fix for empty data
This commit is contained in:
parent
fd44fefb63
commit
3a48a8e349
@ -112,6 +112,9 @@
|
||||
- (NSData * _Nullable)getFaviconDataFromBook:(kiwix::Book *)book {
|
||||
try {
|
||||
std::string dataString = book->getIllustrations().at(0)->getData();
|
||||
if(dataString.length() == 0) {
|
||||
return nil;
|
||||
}
|
||||
NSData *favIconData = [NSData dataWithBytes: dataString.data() length: dataString.length()];
|
||||
return favIconData;
|
||||
} catch (std::exception) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user