Skip to content

Commit

Permalink
Merge pull request #5 from Goobrr/master
Browse files Browse the repository at this point in the history
Pesky null check
  • Loading branch information
GlennFolker authored Sep 15, 2024
2 parents 1c319bd + 8974167 commit 9a9c50c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entity/src/ent/anno/proc/EntityProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ protected void process() throws IOException{
.addParameter(paramSpec(spec(Class.class), tvSpec("E")), "type")
.addParameter(paramSpec(spec(Func.class), spec(String.class), subSpec(tvSpec("T"))), "create")
.beginControlFlow("if(type.getName().startsWith($S))", "mindustry.gen.")
.addStatement("var prov = $T.find($T.idMap, p -> p.get().getClass().equals(type))", spec(Structs.class), spec(EntityMapping.class))
.addStatement("var prov = $T.find($T.idMap, p -> p != null && p.get().getClass().equals(type))", spec(Structs.class), spec(EntityMapping.class))
.addStatement("$T.nameMap.put($S + name, prov)", spec(EntityMapping.class), modName + "-")
.nextControlFlow("else")
.addStatement("$T.nameMap.put($S + name, get(type))", spec(EntityMapping.class), modName + "-")
Expand Down

0 comments on commit 9a9c50c

Please sign in to comment.