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