Skip to content

Commit

Permalink
Fix potential NPE in createRecipe with removed recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNeedsSnacks committed Jan 28, 2024
1 parent cb41cea commit 130a9dc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,13 @@ public void post(RecipeManager recipeManager, Map<ResourceLocation, JsonElement>
private Recipe<?> createRecipe(RecipeJS r) {
try {
var rec = r.createRecipe();
var path = r.kjs$getMod() + "/" + r.getPath();

if (DataExport.export != null) {
DataExport.export.addJson("recipes/" + rec.getId() + ".json", r.json);
if (!r.removed && DataExport.export != null) {
DataExport.export.addJson("recipes/%s.json".formatted(path), r.json);

if (r.newRecipe) {
DataExport.export.addJson("added_recipes/" + rec.getId() + ".json", r.json);
DataExport.export.addJson("added_recipes/%s.json".formatted(path), r.json);
}
}

Expand Down

0 comments on commit 130a9dc

Please sign in to comment.