File tree Expand file tree Collapse file tree
src/main/java/cat/nyaa/nyaacore/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -248,7 +248,9 @@ public static List<ItemStack> itemsFromBase64(String base64) {
248248 if (base64 == null ) throw new IllegalArgumentException ();
249249 base64 = sanitizeBase64 (base64 );
250250 List <ItemStack > stack = itemDeserializerCache .getIfPresent (base64 );
251- if (stack != null ) return stack .stream ().map (ItemStack ::clone ).collect (Collectors .toList ());
251+ if (stack != null ) {
252+ return stack .stream ().map (item -> item == null ? null : item .clone ()).collect (Collectors .toList ());
253+ }
252254 if (base64 .length () <= 0 ) return new ArrayList <>();
253255
254256 byte [] uncompressedBinary = decompress (BaseEncoding .base64 ().decode (base64 ));
@@ -267,7 +269,7 @@ public static List<ItemStack> itemsFromBase64(String base64) {
267269 } catch (IOException ex ) {
268270 throw new RuntimeException (ex );
269271 }
270- itemDeserializerCache .put (base64 , ret .stream ().map (ItemStack :: clone ).collect (Collectors .toList ()));
272+ itemDeserializerCache .put (base64 , ret .stream ().map (item -> item == null ? null : item . clone () ).collect (Collectors .toList ()));
271273 return ret ;
272274 }
273275
You can’t perform that action at this time.
0 commit comments