From 5483861924d549c70924bd4e737d1d163cab26b6 Mon Sep 17 00:00:00 2001 From: Devin Ryan Date: Sun, 13 Apr 2014 16:12:17 -0500 Subject: [PATCH] Prevent crash from a ConversationTracker exception. Fixes BUKKIT-5436 --- ...from-a-ConversationTracker-exception.patch | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 CraftBukkit-Patches/0137-Prevent-crash-from-a-ConversationTracker-exception.patch diff --git a/CraftBukkit-Patches/0137-Prevent-crash-from-a-ConversationTracker-exception.patch b/CraftBukkit-Patches/0137-Prevent-crash-from-a-ConversationTracker-exception.patch new file mode 100644 index 000000000..ffb6dfb7c --- /dev/null +++ b/CraftBukkit-Patches/0137-Prevent-crash-from-a-ConversationTracker-exception.patch @@ -0,0 +1,40 @@ +From bd5de624cf81503ac6f5309bdd61446e9a677518 Mon Sep 17 00:00:00 2001 +From: Devin Ryan +Date: Mon, 14 Apr 2014 11:33:48 +1000 +Subject: [PATCH] Prevent crash from a ConversationTracker exception. + +Fixes BUKKIT-5436 + +diff --git a/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java b/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java +index 1d770a5..497d1d7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java ++++ b/src/main/java/org/bukkit/craftbukkit/conversations/ConversationTracker.java +@@ -1,10 +1,12 @@ + package org.bukkit.craftbukkit.conversations; + ++import org.bukkit.Bukkit; + import org.bukkit.conversations.Conversation; + import org.bukkit.conversations.ConversationAbandonedEvent; + import org.bukkit.conversations.ManuallyAbandonedConversationCanceller; + + import java.util.LinkedList; ++import java.util.logging.Level; + + /** + */ +@@ -43,7 +45,11 @@ public class ConversationTracker { + LinkedList oldQueue = conversationQueue; + conversationQueue = new LinkedList(); + for(Conversation conversation : oldQueue) { +- conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller())); ++ try { ++ conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller())); ++ } catch (Throwable t) { ++ Bukkit.getLogger().log(Level.SEVERE, "Unexpected exception while abandoning a conversation", t); ++ } + } + } + +-- +1.8.3.2 +