Now reporting unsupported entryId's correctly.

This commit is contained in:
Rob Greene 2018-05-27 10:36:43 -05:00
parent ae4a1272d0
commit 0254426160
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ public class AppleSingle {
byte[] entryData = new byte[length];
buffer.get(entryData);
// Defer to the proper set method or crash if we don't support that type of entry
Optional.of(entryConsumers.get(entryId))
Optional.ofNullable(entryConsumers.get(entryId))
.orElseThrow(() -> new IOException(String.format("Unknown entry type of %04X", entryId)))
.accept(entryData);
buffer.reset();