From 6fc52d0162cf0133bc69d2bef9190f08109e78b1 Mon Sep 17 00:00:00 2001 From: Xtr126 Date: Sun, 25 Feb 2024 12:10:46 +0530 Subject: [PATCH] fix: check if cursorView is null --- app/src/main/java/xtr/keymapper/server/InputService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/xtr/keymapper/server/InputService.java b/app/src/main/java/xtr/keymapper/server/InputService.java index 09932c30..21ef60e6 100644 --- a/app/src/main/java/xtr/keymapper/server/InputService.java +++ b/app/src/main/java/xtr/keymapper/server/InputService.java @@ -102,14 +102,14 @@ public IRemoteServiceCallback getCallback() { } public void moveCursorX(float x) { - cursorView.setX(x); + if(cursorView != null) cursorView.setX(x); // To avoid conflict with touch input when moving virtual pointer if (input.pointerCount < 1) cursorSetX((int) x); else if (input.pointerCount == 1 && pointerUp) cursorSetX((int) x); } public void moveCursorY(float y) { - cursorView.setY(y); + if(cursorView != null) cursorView.setY(y); // To avoid conflict with touch input when moving virtual pointer if (input.pointerCount < 1) cursorSetY((int) y); else if (input.pointerCount == 1 && pointerUp) cursorSetY((int) y);