mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-26 04:25:37 +01:00
Add a null check around some block safety checks
This commit is contained in:
parent
327f0ce7c4
commit
48f8e033b6
@ -50,6 +50,11 @@ public class BlockSafety {
|
|||||||
* @return Whether the player can spawn safely at the given {@link Location}
|
* @return Whether the player can spawn safely at the given {@link Location}
|
||||||
*/
|
*/
|
||||||
public boolean playerCanSpawnHereSafely(Location l) {
|
public boolean playerCanSpawnHereSafely(Location l) {
|
||||||
|
if(l == null) {
|
||||||
|
// Can't safely spawn at a null location!
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
World world = l.getWorld();
|
World world = l.getWorld();
|
||||||
Location actual = l.clone();
|
Location actual = l.clone();
|
||||||
Location upOne = l.clone();
|
Location upOne = l.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user