diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/TicketUtils.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/TicketUtils.java index 2b5301f..d22a287 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/TicketUtils.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/TicketUtils.java @@ -10,8 +10,10 @@ import de.mas.wiiu.jnus.utils.FileUtils; public class TicketUtils { public static Optional getTicket(File folder, File keyFolder, long titleID, byte[] commonKey) { - File ticketFile = FileUtils.getFileIgnoringFilenameCases(folder.getAbsolutePath(), "title.tik"); - + File ticketFile = null; + if (folder != null) { + ticketFile = FileUtils.getFileIgnoringFilenameCases(folder.getAbsolutePath(), "title.tik"); + } Ticket ticket = null; if (ticketFile != null && ticketFile.exists()) { try { @@ -19,9 +21,10 @@ public class TicketUtils { } catch (IOException e) { } } + if (ticket == null && keyFolder != null) { File keyFile = FileUtils.getFileIgnoringFilenameCases(keyFolder.getAbsolutePath(), String.format("%016X", titleID) + ".key"); - if (keyFile.exists()) { + if (keyFile != null && keyFile.exists()) { byte[] key; try { key = Files.readAllBytes(keyFile.toPath());