From ceeeb5802ca7465baf6984b65838db6d81838387 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Tue, 12 Jan 2016 13:22:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=AB=E5=9C=B0=E5=A4=A7?= =?UTF-8?q?=E5=A6=88=E8=BF=94=E5=9B=9Enull=E6=97=B6=E7=9A=84=E6=8A=A5?= =?UTF-8?q?=E9=94=99...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../Listeners/WowSuchCleanerListener.java | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/maxgamer/QuickShop/Listeners/WowSuchCleanerListener.java b/src/main/java/org/maxgamer/QuickShop/Listeners/WowSuchCleanerListener.java index 697380b..e154061 100644 --- a/src/main/java/org/maxgamer/QuickShop/Listeners/WowSuchCleanerListener.java +++ b/src/main/java/org/maxgamer/QuickShop/Listeners/WowSuchCleanerListener.java @@ -12,21 +12,27 @@ import org.maxgamer.QuickShop.Util.MarkUtil; import io.github.Cnly.WowSuchCleaner.WowSuchCleaner.ItemPreCleanEvent; public class WowSuchCleanerListener implements Listener { - @EventHandler - public void onWSCClear(final ItemPreCleanEvent e) { - final List clearList = new ArrayList(); - final List aucList = new ArrayList(); - for (final Item item : e.getItemsToClean()) { - if (MarkUtil.hasMark(item.getItemStack())) { - clearList.add(item); - } - } - for (final ItemStack itemStack : e.getItemsToAuction()) { - if (MarkUtil.hasMark(itemStack)) { - aucList.add(itemStack); - } - } - e.getItemsToClean().removeAll(clearList); - e.getItemsToAuction().removeAll(aucList); - } + @EventHandler + public void onWSCClear(final ItemPreCleanEvent e) { + final List clearList = new ArrayList(); + final List aucList = new ArrayList(); + final List cleanList = e.getItemsToClean(); + final List acList = e.getItemsToAuction(); + if (cleanList != null) { + for (final Item item : cleanList) { + if (MarkUtil.hasMark(item.getItemStack())) { + clearList.add(item); + } + } + e.getItemsToClean().removeAll(clearList); + } + if (acList != null) { + for (final ItemStack itemStack : acList) { + if (MarkUtil.hasMark(itemStack)) { + aucList.add(itemStack); + } + } + e.getItemsToAuction().removeAll(aucList); + } + } }