The parent of a FSTEntry is now an optional, let's check if it exists before using it.

This commit is contained in:
Maschell 2019-04-24 13:33:38 +02:00
parent 3005ed981f
commit 93330d24a6
2 changed files with 21 additions and 17 deletions

View File

@ -92,7 +92,7 @@
<dependency> <dependency>
<groupId>com.github.Maschell</groupId> <groupId>com.github.Maschell</groupId>
<artifactId>JNUSLib</artifactId> <artifactId>JNUSLib</artifactId>
<version>75e28a7</version> <version>c47c991</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>

View File

@ -40,7 +40,9 @@ public class WUDMountedFuseContainer extends WUDFuseContainer {
try { try {
for (FSTDataProvider dp : dps) { for (FSTDataProvider dp : dps) {
for (FSTEntry tmd : FSTUtils.getFSTEntriesByRegEx(dp.getRoot(), ".*tmd")) { for (FSTEntry tmd : FSTUtils.getFSTEntriesByRegEx(dp.getRoot(), ".*tmd")) {
FSTEntry parent = tmd.getParent(); Optional<FSTEntry> parentOpt = tmd.getParent();
if (parentOpt.isPresent()) {
FSTEntry parent = parentOpt.get();
if (parent.getFileChildren().stream().filter(f -> f.getFilename().endsWith(".app")).findAny().isPresent()) { if (parent.getFileChildren().stream().filter(f -> f.getFilename().endsWith(".app")).findAny().isPresent()) {
FSTDataProvider fdp = null; FSTDataProvider fdp = null;
@ -60,7 +62,9 @@ public class WUDMountedFuseContainer extends WUDFuseContainer {
FSTDataProvider fdpCpy = fdp; FSTDataProvider fdpCpy = fdp;
this.addFuseContainer("[DECRYPTED] [" + dp.getName() + "] " + parent.getFilename(), new FSTDataProviderContainer(getParent(), fdpCpy)); this.addFuseContainer("[DECRYPTED] [" + dp.getName() + "] " + parent.getFilename(),
new FSTDataProviderContainer(getParent(), fdpCpy));
}
} }
} }