1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 02:39:23 +02:00

* An NPE during library starting has been fixed (this NPE only occures on systems with locale "not supported" by FBReader (like Spanish, Finnish, Japan, etc.)

This commit is contained in:
Nikolay Pultsin 2010-11-11 18:33:09 +00:00
parent b9f5490af9
commit 6dc9b385d8
3 changed files with 21 additions and 4 deletions

View file

@ -1,3 +1,7 @@
===== 0.7.16 (Nov 11, 2010) =====
* Czech resources have been updated
* An NPE during library starting has been fixed (this NPE only occures on systems with locale "not supported" by FBReader (like Spanish, Finnish, Japan, etc.)
===== 0.7.15 (Nov 11, 2010) =====
* External TTF fonts are supported (for Android version >= 1.6)
* Ukrainian localization (by Dmytro Shevchenko) has been added

View file

@ -215,9 +215,6 @@ public final class Library {
collectBooks();
//System.err.println(myBooks.size() + " books " + System.currentTimeMillis() % 20000);
for (Book book : myBooks) {
if (book == null) {
continue;
}
bookById.put(book.getId(), book);
List<Author> authors = book.authors();
if (authors.isEmpty()) {

View file

@ -198,8 +198,24 @@ public final class ZLAndroidLibrary extends ZLibrary {
@Override
public boolean exists() {
try {
AssetFileDescriptor descriptor = myApplication.getAssets().openFd(getPath());
if (descriptor != null) {
descriptor.close();
// file exists
return true;
}
} catch (IOException e) {
}
try {
String[] names = myApplication.getAssets().list(getPath());
if (names != null && names.length != 0) {
return true;
}
} catch (IOException e) {
}
return false;
}
@Override
public long size() {