Recover from IllegalStateException when polling clipboard.

This commit is contained in:
Sleaze 2016-10-01 13:22:38 -07:00 committed by metaprime
parent 33dfa1f073
commit b5ee49c9db

View File

@ -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) {