From b5ee49c9db4f81cb204b13f575e6c4b7ce9104f0 Mon Sep 17 00:00:00 2001 From: Sleaze Date: Sat, 1 Oct 2016 13:22:38 -0700 Subject: [PATCH] Recover from IllegalStateException when polling clipboard. --- src/main/java/com/rarchives/ripme/ui/ClipboardUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/rarchives/ripme/ui/ClipboardUtils.java b/src/main/java/com/rarchives/ripme/ui/ClipboardUtils.java index 883336a1..8b68a4b2 100644 --- a/src/main/java/com/rarchives/ripme/ui/ClipboardUtils.java +++ b/src/main/java/com/rarchives/ripme/ui/ClipboardUtils.java @@ -10,6 +10,8 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static com.rarchives.ripme.App.logger; + public class ClipboardUtils { private static AutoripThread autoripThread = new AutoripThread(); @@ -33,6 +35,9 @@ public class ClipboardUtils { .getDefaultToolkit() .getSystemClipboard() .getData(DataFlavor.stringFlavor); + } catch (IllegalStateException e) { + e.printStackTrace(); + logger.error("Caught and recovered from IllegalStateException: " + e.getMessage()); } catch (HeadlessException e) { e.printStackTrace(); } catch (UnsupportedFlavorException e) {