if (Type.STATELESS.equals(loadType()) || !pieceSetMap.containsKey(name)) {
String piecePath = FilenameUtils.getFullPath(PIECES_DIR, name);
pieceSet = loadPieces(piecePath);
if (Type.STATELESS.equals(loadType()) || !pieceSetMap.containsKey(name)) {
String piecePath = FilenameUtils.getFullPath(PIECES_DIR, name);
pieceSet = loadPieces(piecePath);
- return pieceSet.isFull()
- ? pieceSet
- : null; // todo: ImageException
+ if (!pieceSet.isFilled()) {
+ throw new ImageException("image.incomplete.piece.set", piecePath);
+ }
+ return pieceSet;