From 536c28a3b15cb6c57eaa39d2fc7544b46a588848 Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 10 Apr 2019 18:08:56 +0200 Subject: [PATCH] Throw a ParseException on error in the ContentFSTInfo --- src/de/mas/wiiu/jnus/entities/content/ContentFSTInfo.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/de/mas/wiiu/jnus/entities/content/ContentFSTInfo.java b/src/de/mas/wiiu/jnus/entities/content/ContentFSTInfo.java index 4701997..ed92797 100644 --- a/src/de/mas/wiiu/jnus/entities/content/ContentFSTInfo.java +++ b/src/de/mas/wiiu/jnus/entities/content/ContentFSTInfo.java @@ -17,6 +17,7 @@ package de.mas.wiiu.jnus.entities.content; import java.nio.ByteBuffer; +import java.text.ParseException; import lombok.Data; import lombok.EqualsAndHashCode; @@ -54,11 +55,12 @@ public final class ContentFSTInfo { * @param input * 0x20 byte of data from the FST (starting at 0x20) * @return ContentFSTInfo object + * @throws ParseException */ - public static ContentFSTInfo parseContentFST(byte[] input) { + public static ContentFSTInfo parseContentFST(byte[] input) throws ParseException { if (input == null || input.length != 0x20) { log.info("Error: invalid ContentFSTInfo byte[] input"); - return null; + throw new ParseException("Failed to parse ContentFSTInfo", 0); } ContentFSTInfoParam param = new ContentFSTInfoParam(); ByteBuffer buffer = ByteBuffer.allocate(input.length);