mirror of
https://github.com/Maschell/JNUSLib.git
synced 2024-11-05 15:55:12 +01:00
Only throw an exception in the FSTService when a content for a given wasn't found if the Map is emtpy
This commit is contained in:
parent
03181f6078
commit
06184da8d3
@ -104,12 +104,12 @@ public final class FSTService {
|
|||||||
if (contentsByIndex != null) {
|
if (contentsByIndex != null) {
|
||||||
Content content = contentsByIndex.get((int) contentIndex);
|
Content content = contentsByIndex.get((int) contentIndex);
|
||||||
if (content == null) {
|
if (content == null) {
|
||||||
if (!entryParam.isDir() || entryParam.isNotInPackage()) {
|
if ((!entryParam.isDir() || entryParam.isNotInPackage()) && !contentsByIndex.isEmpty()) {
|
||||||
|
// This is only a problem when the data is NOT on aWUDDataPartition (they have no content files)
|
||||||
log.warning("Content for FST Entry not found");
|
log.warning("Content for FST Entry not found");
|
||||||
throw new ParseException("Content for FST Entry not found", 0);
|
throw new ParseException("Content for FST Entry not found", 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: make content attribute in a fstentry optional
|
|
||||||
entryParam.setContent(Optional.of(content));
|
entryParam.setContent(Optional.of(content));
|
||||||
ContentFSTInfo contentFSTInfo = contentsFSTByIndex.get((int) contentIndex);
|
ContentFSTInfo contentFSTInfo = contentsFSTByIndex.get((int) contentIndex);
|
||||||
if (contentFSTInfo == null) {
|
if (contentFSTInfo == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user