Skip to content

Commit 27e285d

Browse files
committed
Fix an NPE
1 parent fbbc218 commit 27e285d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

station-recipes-v0/src/main/java/net/modificationstation/stationapi/impl/recipe/StationShapedRecipe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,6 @@ public ItemStack[] getOutputs() {
105105

106106
public Either<TagKey<Item>, ItemStack>[] getGrid() {
107107
//noinspection unchecked
108-
return (Either<TagKey<Item>, ItemStack>[]) Arrays.stream(grid).map(entry -> entry.mapRight(ItemStack::copy)).toArray(Either[]::new);
108+
return (Either<TagKey<Item>, ItemStack>[]) Arrays.stream(grid).map(entry -> entry == null ? null : entry.mapRight(ItemStack::copy)).toArray(Either[]::new);
109109
}
110110
}

station-recipes-v0/src/main/java/net/modificationstation/stationapi/impl/recipe/StationShapelessRecipe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ public ItemStack[] getOutputs() {
9797
@Deprecated
9898
public Either<TagKey<Item>, ItemStack>[] getInputs() {
9999
//noinspection unchecked
100-
return (Either<TagKey<Item>, ItemStack>[]) Arrays.stream(ingredients).map(entry -> entry.mapRight(ItemStack::copy)).toArray(Either[]::new);
100+
return (Either<TagKey<Item>, ItemStack>[]) Arrays.stream(ingredients).map(entry -> entry == null ? null : entry.mapRight(ItemStack::copy)).toArray(Either[]::new);
101101
}
102102
}

0 commit comments

Comments
 (0)