Skip to content

Commit

Permalink
Add missing null checks. Fixes Lunatriusgh-299
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatrius committed Jan 6, 2018
1 parent 485a0bd commit 7171cb0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ public void onKeyInput(final InputEvent event) {

if (KEY_BINDING_LAYER_INC.isPressed()) {
final SchematicWorld schematic = ClientProxy.schematic;
if (schematic.layerMode != LayerMode.ALL) {
if (schematic != null && schematic.layerMode != LayerMode.ALL) {
schematic.renderingLayer = MathHelper.clamp(schematic.renderingLayer + 1, 0, schematic.getHeight() - 1);
RenderSchematic.INSTANCE.refresh();
}
}

if (KEY_BINDING_LAYER_DEC.isPressed()) {
final SchematicWorld schematic = ClientProxy.schematic;
if (schematic.layerMode != LayerMode.ALL) {
if (schematic != null && schematic.layerMode != LayerMode.ALL) {
schematic.renderingLayer = MathHelper.clamp(schematic.renderingLayer - 1, 0, schematic.getHeight() - 1);
RenderSchematic.INSTANCE.refresh();
}
Expand Down

0 comments on commit 7171cb0

Please sign in to comment.