Permalink
Browse files

IvnentoruClickEvent sometimes passes null inventories or inventories …

…with null holders
  • Loading branch information...
me4502 committed Oct 10, 2018
1 parent e0b91e9 commit 5ad21521be0643d42e13c15eef4a9bf39a12a0e9
@@ -2,7 +2,7 @@ apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
maven { url "http://repo.bstats.org/content/repositories/releases/" }
maven { url "https://jitpack.io" }
}
dependencies {
@@ -13,7 +13,7 @@ dependencies {
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 @@ shadowJar {
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()));

0 comments on commit 5ad2152

Please sign in to comment.