papermc/Bukkit-Patches/0015-Catch-Conversation-API-Errors.patch

35 lines
1.1 KiB
Diff
Raw Normal View History

2013-08-07 07:16:57 +00:00
From fb52162279c4bf3d6c38cf9f731e60addeffb073 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 22 Jul 2013 19:09:43 +1000
Subject: [PATCH] Catch Conversation API Errors
diff --git a/src/main/java/org/bukkit/conversations/Conversation.java b/src/main/java/org/bukkit/conversations/Conversation.java
2013-08-07 07:16:57 +00:00
index a30745f..55c9785 100644
--- a/src/main/java/org/bukkit/conversations/Conversation.java
+++ b/src/main/java/org/bukkit/conversations/Conversation.java
2013-08-07 07:16:57 +00:00
@@ -193,6 +193,7 @@ public class Conversation {
* @param input The user's chat text.
*/
public void acceptInput(String input) {
+ try { // Spigot
if (currentPrompt != null) {
// Echo the user's input
2013-08-07 07:16:57 +00:00
@@ -212,6 +213,12 @@ public class Conversation {
currentPrompt = currentPrompt.acceptInput(context, input);
outputNextPrompt();
}
+ // Spigot Start
+ } catch ( Throwable t )
+ {
+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.SEVERE, "Error handling conversation prompt", t );
+ }
+ // Spigot End
}
/**
--
1.8.1.2