From d8ffe258c3d48dedaa2f4a01cf6c6ae9a31a560b Mon Sep 17 00:00:00 2001 From: isha382 Date: Mon, 11 Nov 2024 11:58:29 +0530 Subject: [PATCH] null pointer exception in autopilot and object navigation fragment --- .../main/java/org/openbot/autopilot/AutopilotFragment.java | 5 +++-- .../main/java/org/openbot/objectNav/ObjectNavFragment.java | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/android/robot/src/main/java/org/openbot/autopilot/AutopilotFragment.java b/android/robot/src/main/java/org/openbot/autopilot/AutopilotFragment.java index 2754a88d8..b9e327f65 100644 --- a/android/robot/src/main/java/org/openbot/autopilot/AutopilotFragment.java +++ b/android/robot/src/main/java/org/openbot/autopilot/AutopilotFragment.java @@ -204,8 +204,9 @@ private void updateCropImageInfo() { binding.trackingOverlay.addCallback( canvas -> { - tracker.draw(canvas); - // tracker.drawDebug(canvas); + if (tracker != null) { + tracker.draw(canvas); + } }); tracker.setFrameConfiguration( getMaxAnalyseImageSize().getWidth(), diff --git a/android/robot/src/main/java/org/openbot/objectNav/ObjectNavFragment.java b/android/robot/src/main/java/org/openbot/objectNav/ObjectNavFragment.java index 4729cf253..ee65e123c 100644 --- a/android/robot/src/main/java/org/openbot/objectNav/ObjectNavFragment.java +++ b/android/robot/src/main/java/org/openbot/objectNav/ObjectNavFragment.java @@ -267,8 +267,10 @@ private void updateCropImageInfo() { binding.trackingOverlay.addCallback( canvas -> { - tracker.draw(canvas); - // tracker.drawDebug(canvas); + if (tracker != null) { + tracker.draw(canvas); + } + //tracker.drawDebug(canvas); }); tracker.setFrameConfiguration( getMaxAnalyseImageSize().getWidth(),