From 4d2d3403d6ee91318e168476d4995d8e34b3d999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 5 Aug 2024 21:41:39 +0200 Subject: [PATCH] Fix build error --- .../beatrice/autosqueal/controls/CursorMover.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/wtf/beatrice/autosqueal/controls/CursorMover.java b/src/main/java/wtf/beatrice/autosqueal/controls/CursorMover.java index 8654d8f..5723d31 100644 --- a/src/main/java/wtf/beatrice/autosqueal/controls/CursorMover.java +++ b/src/main/java/wtf/beatrice/autosqueal/controls/CursorMover.java @@ -41,14 +41,24 @@ public class CursorMover extends TimerTask destX = RunnerUtil.SCREEN_WIDTH - 5; destY = 5; - singleStepMovementTask = new SingleStepMovementTask(destX, destY, true); + try { + singleStepMovementTask = new SingleStepMovementTask(destX, destY, true); + } catch (AWTException e) { + LOGGER.error(e); + return; + } iteration = 0; } else { destX = random.nextInt(RunnerUtil.SCREEN_WIDTH); destY = random.nextInt(RunnerUtil.SCREEN_HEIGHT); - singleStepMovementTask = new SingleStepMovementTask(destX, destY, false); + try { + singleStepMovementTask = new SingleStepMovementTask(destX, destY, false); + } catch (AWTException e) { + LOGGER.error(e); + return; + } iteration++; }