Skip to content

Commit

Permalink
Prevent returning null from IIngredients
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Sep 26, 2016
1 parent 35ad02e commit 3fe305f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -5,4 +5,4 @@ curse_project_id=238222

version_major=3
version_minor=11
version_patch=0
version_patch=1
12 changes: 10 additions & 2 deletions src/main/java/mezz/jei/util/Ingredients.java
Expand Up @@ -69,13 +69,21 @@ public <T> void setOutputs(Class<T> ingredientClass, List<T> outputs) {
@Override
public <T> List<List<T>> getInputs(Class<T> ingredientClass) {
//noinspection unchecked
return (List<List<T>>) (Object) this.inputs.get(ingredientClass);
List<List<T>> inputs = (List<List<T>>) (Object) this.inputs.get(ingredientClass);
if (inputs == null) {
return Collections.emptyList();
}
return inputs;
}

@Override
public <T> List<T> getOutputs(Class<T> ingredientClass) {
//noinspection unchecked
return this.outputs.get(ingredientClass);
List<T> outputs = this.outputs.get(ingredientClass);
if (outputs == null) {
return Collections.emptyList();
}
return outputs;
}

public Map<Class, List> getInputIngredients() {
Expand Down

0 comments on commit 3fe305f

Please sign in to comment.