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

NPE fixes

This commit is contained in:
Nikolay Pultsin 2011-12-14 00:42:59 +00:00
parent 281b4367e4
commit d9437516fd
3 changed files with 16 additions and 9 deletions

View file

@ -33,13 +33,16 @@ public class FileFirstLevelTree extends FirstLevelTree {
}
private void addChild(String path, String resourceKey) {
final ZLResource resource = Library.resource().getResource(resourceKey);
new FileTree(
this,
ZLFile.createFileByPath(path),
resource.getValue(),
resource.getResource("summary").getValue()
);
final ZLFile file = ZLFile.createFileByPath(path);
if (file != null) {
final ZLResource resource = Library.resource().getResource(resourceKey);
new FileTree(
this,
file,
resource.getValue(),
resource.getResource("summary").getValue()
);
}
}
@Override