mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
NPE fixes
This commit is contained in:
parent
281b4367e4
commit
d9437516fd
3 changed files with 16 additions and 9 deletions
|
@ -33,14 +33,17 @@ public class FileFirstLevelTree extends FirstLevelTree {
|
|||
}
|
||||
|
||||
private void addChild(String path, String resourceKey) {
|
||||
final ZLFile file = ZLFile.createFileByPath(path);
|
||||
if (file != null) {
|
||||
final ZLResource resource = Library.resource().getResource(resourceKey);
|
||||
new FileTree(
|
||||
this,
|
||||
ZLFile.createFileByPath(path),
|
||||
file,
|
||||
resource.getValue(),
|
||||
resource.getResource("summary").getValue()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTreeTitle() {
|
||||
|
|
|
@ -33,7 +33,7 @@ public class FileTree extends LibraryTree {
|
|||
private final String mySummary;
|
||||
private final boolean myIsSelectable;
|
||||
|
||||
public FileTree(LibraryTree parent, ZLFile file, String name, String summary) {
|
||||
FileTree(LibraryTree parent, ZLFile file, String name, String summary) {
|
||||
super(parent);
|
||||
myFile = file;
|
||||
myName = name;
|
||||
|
|
|
@ -217,7 +217,11 @@ public final class NetworkImage extends ZLLoadableImage {
|
|||
if (path == null) {
|
||||
return null;
|
||||
}
|
||||
myFileImage = new ZLFileImage(mimeType(), ZLFile.createFileByPath(path));
|
||||
final ZLFile file = ZLFile.createFileByPath(path);
|
||||
if (file == null) {
|
||||
return null;
|
||||
}
|
||||
myFileImage = new ZLFileImage(mimeType(), file);
|
||||
}
|
||||
return myFileImage.inputStream();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue