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(),