From 422c36dde3787a4190abdff473190a161169099e Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 10 Apr 2019 18:47:57 +0200 Subject: [PATCH] Throw a ParseException instead of returning null in the ContentInfo --- src/de/mas/wiiu/jnus/entities/content/ContentInfo.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/de/mas/wiiu/jnus/entities/content/ContentInfo.java b/src/de/mas/wiiu/jnus/entities/content/ContentInfo.java index 33f702a..5edbcc2 100644 --- a/src/de/mas/wiiu/jnus/entities/content/ContentInfo.java +++ b/src/de/mas/wiiu/jnus/entities/content/ContentInfo.java @@ -17,6 +17,7 @@ package de.mas.wiiu.jnus.entities.content; import java.nio.ByteBuffer; +import java.text.ParseException; import java.util.Arrays; import lombok.EqualsAndHashCode; @@ -62,11 +63,12 @@ public class ContentInfo { * @param input * 0x24 byte of data from the TMD (starting at 0x208) * @return ContentFSTInfo object + * @throws ParseException */ - public static ContentInfo parseContentInfo(byte[] input) { + public static ContentInfo parseContentInfo(byte[] input) throws ParseException { if (input == null || input.length != CONTENT_INFO_SIZE) { log.info("Error: invalid ContentInfo byte[] input"); - return null; + throw new ParseException("Error: invalid ContentInfo byte[] input", 0); } ByteBuffer buffer = ByteBuffer.allocate(input.length);