From 353964045a14a76bb83f67626af21c7b593e29e2 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 10 Nov 2017 10:44:27 +1100 Subject: [PATCH] Catch all exceptions from plugin conversation handling --- .../craftbukkit/conversations/ConversationTracker.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java b/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java index 30ef7d9afb..eefa68a695 100644 --- a/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java +++ b/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java @@ -55,7 +55,15 @@ public class ConversationTracker { public synchronized void acceptConversationInput(String input) { if (isConversing()) { - conversationQueue.getFirst().acceptInput(input); + Conversation conversation = conversationQueue.getFirst(); + try { + conversation.acceptInput(input); + } catch (Throwable t) { + conversation.getContext().getPlugin().getLogger().log(Level.WARNING, + String.format("Plugin %s generated an exception whilst handling conversation input", + conversation.getContext().getPlugin().getDescription().getFullName() + ), t); + } } }