mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-28 12:07:46 +01:00
IvnentoruClickEvent sometimes passes null inventories or inventories with null holders
This commit is contained in:
parent
e0b91e9529
commit
5ad21521be
@ -2,7 +2,7 @@
|
||||
apply plugin: 'idea'
|
||||
|
||||
repositories {
|
||||
maven { url "http://repo.bstats.org/content/repositories/releases/" }
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -13,7 +13,7 @@ compile project(':worldguard-core')
|
||||
exclude group: 'com.sk89q', module: 'worldedit'
|
||||
exclude group: 'com.zachsthings.libcomponents'
|
||||
}
|
||||
compile 'org.bstats:bstats-bukkit:1.2'
|
||||
compileOnly 'org.bstats.bStats-Metrics:bstats-bukkit:1.3'
|
||||
testCompile 'junit:junit:4.11'
|
||||
testCompile 'org.hamcrest:hamcrest-library:1.2.1'
|
||||
}
|
||||
@ -33,7 +33,7 @@ compile project(':worldguard-core')
|
||||
dependencies {
|
||||
include(dependency(':worldguard-core'))
|
||||
relocate ("org.bstats", "com.sk89q.worldguard.bukkit.bstats") {
|
||||
include(dependency("org.bstats:bstats-bukkit:1.2"))
|
||||
include(dependency("org.bstats.bStats-Metrics:bstats-bukkit:1.3"))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ public void onInventoryClick(InventoryClickEvent event) {
|
||||
Inventory inventory = event.getInventory();
|
||||
ItemStack item = event.getCurrentItem();
|
||||
|
||||
if (item != null && entity instanceof Player) {
|
||||
if (item != null && inventory != null && inventory.getHolder() != null && entity instanceof Player) {
|
||||
Player player = (Player) entity;
|
||||
ConfigurationManager cfg = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
|
||||
BukkitWorldConfiguration wcfg = (BukkitWorldConfiguration) cfg.get(BukkitAdapter.adapt(entity.getWorld()));
|
||||
|
Loading…
Reference in New Issue
Block a user