Fix NPE in OctopusForm

This commit is contained in:
Jack Lin 2015-06-30 01:39:04 +12:00
parent 89ee1470e8
commit 42c750862f

View file

@ -227,8 +227,9 @@ public class OctopusForm {
sourcelocation.add(vector); sourcelocation.add(vector);
Block newblock = sourcelocation.getBlock(); Block newblock = sourcelocation.getBlock();
if (!newblock.equals(sourceblock)) { if (!newblock.equals(sourceblock)) {
source.revertBlock(); if (source != null) {
source = null; source.revertBlock();
}
if (!GeneralMethods.isSolid(newblock)) { if (!GeneralMethods.isSolid(newblock)) {
source = new TempBlock(newblock, Material.STATIONARY_WATER, (byte) 8); source = new TempBlock(newblock, Material.STATIONARY_WATER, (byte) 8);
sourceblock = newblock; sourceblock = newblock;