Do not crash when reading null planets
This commit is contained in:
@@ -106,7 +106,7 @@ public enum EditorTool{
|
|||||||
|
|
||||||
if(tile == null) return;
|
if(tile == null) return;
|
||||||
|
|
||||||
if(editor.drawBlock.isMultiblock()){
|
if(editor.drawBlock.isMultiblock() && (mode == 0 || mode == -1)){
|
||||||
//don't fill multiblocks, thanks
|
//don't fill multiblocks, thanks
|
||||||
pencil.touched(x, y);
|
pencil.touched(x, y);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -195,6 +195,9 @@ public class JsonIO{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Planet read(Json json, JsonValue jsonData, Class type){
|
public Planet read(Json json, JsonValue jsonData, Class type){
|
||||||
|
if(jsonData.asString() == null){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
Planet block = Vars.content.getByName(ContentType.planet, jsonData.asString());
|
Planet block = Vars.content.getByName(ContentType.planet, jsonData.asString());
|
||||||
return block == null ? Planets.serpulo : block;
|
return block == null ? Planets.serpulo : block;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user