Fix NPE in blocksource

This commit is contained in:
jedk1 2016-04-17 14:37:15 +01:00
parent eaf183f8c4
commit d930c78d16

View file

@ -156,10 +156,13 @@ public class BlockSource {
*/ */
public static Block getSourceBlock(Player player, double range, BlockSourceType sourceType, ClickType clickType) { public static Block getSourceBlock(Player player, double range, BlockSourceType sourceType, ClickType clickType) {
BlockSourceInformation info = getValidBlockSourceInformation(player, range, sourceType, clickType); BlockSourceInformation info = getValidBlockSourceInformation(player, range, sourceType, clickType);
if (info != null) {
if (TempBlock.isTempBlock(info.getBlock())) { if (TempBlock.isTempBlock(info.getBlock())) {
return null; return null;
} }
return info != null ? info.getBlock() : null; return info.getBlock();
}
return null;
} }
/** /**