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

fixed possible NPE

This commit is contained in:
Nikolay Pultsin 2011-01-30 11:10:12 +00:00
parent b17910b344
commit 2d43e40af3

View file

@ -502,12 +502,12 @@ public final class FBView extends ZLTextView {
return myReader.FooterHeightOption.getValue(); return myReader.FooterHeightOption.getValue();
} }
public void resetTOCMarks() { public synchronized void resetTOCMarks() {
myTOCMarks = null; myTOCMarks = null;
} }
private final int MAX_TOC_MARKS_NUMBER = 100; private final int MAX_TOC_MARKS_NUMBER = 100;
private void updateTOCMarks(BookModel model) { private synchronized void updateTOCMarks(BookModel model) {
myTOCMarks = new ArrayList<TOCTree>(); myTOCMarks = new ArrayList<TOCTree>();
TOCTree toc = model.TOCTree; TOCTree toc = model.TOCTree;
if (toc == null) { if (toc == null) {
@ -535,7 +535,7 @@ public final class FBView extends ZLTextView {
} }
} }
public void paint(ZLPaintContext context) { public synchronized void paint(ZLPaintContext context) {
final FBReaderApp reader = myReader; final FBReaderApp reader = myReader;
if (reader == null) { if (reader == null) {
return; return;