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

fixed NPE

This commit is contained in:
Nikolay Pultsin 2013-01-13 11:01:30 +04:00
parent 6f6fdf6b12
commit 0ddf4550fd
2 changed files with 12 additions and 1 deletions

View file

@ -172,12 +172,19 @@ public class LibraryService extends Service {
public TextPosition getStoredPosition(long bookId) {
final ZLTextPosition position = myCollection.getStoredPosition(bookId);
if (position == null) {
return null;
}
return new TextPosition(
position.getParagraphIndex(), position.getElementIndex(), position.getCharIndex()
);
}
public void storePosition(long bookId, TextPosition position) {
if (position == null) {
return;
}
myCollection.storePosition(bookId, new ZLTextFixedPosition(
position.ParagraphIndex, position.ElementIndex, position.CharIndex
));