enioka-Haute-Couture / enioka_scan

Integration library for all your Android hardware barcode scanner integration needs
Apache License 2.0
52 stars 4 forks source link

Blocage NullPointerException dans CameraBarcodeScanViewV1.getTorchOn #155

Closed fmanoir closed 9 months ago

fmanoir commented 10 months ago

Bonjour @DaSpood, @marcanpilami

Après notre mise à jour de notre application sur le store, Google indique un blocage.

il suffit d'ajouter un test. ( if prms.getFlashMode() != null ) avant prms.getFlashMode().equals(Camera.Parameters.FLASH_MODE_TORCH);

Voila la Trace de la pile :

Exception java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
  at com.enioka.scanner.camera.CameraBarcodeScanViewV1.getTorchOn (CameraBarcodeScanViewV1.java:393)
  at com.enioka.scanner.camera.CameraBarcodeScanView.getTorchOn (CameraBarcodeScanView.java:166)
  at com.enioka.scanner.sdk.camera.CameraBarcodeScanViewScanner.toggleIllumination (CameraBarcodeScanViewScanner.java:162)
  at com.enioka.scanner.api.Scanner$WithIlluminationSupport.toggleIllumination (Scanner.java:344)
  at com.enioka.scanner.activities.ScannerCompatActivity.lambda$displayTorch$1 (ScannerCompatActivity.java:485)
  at android.view.View.performClick (View.java:6597)
  at android.view.View.performClickInternal (View.java:6574)
  at android.view.View.access$3100 (View.java:778)
  at android.view.View$PerformClick.run (View.java:25885)
  at android.os.Handler.handleCallback (Handler.java:873)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at androidx.test.espresso.base.Interrogator.loopAndInterrogate (Interrogator.java:10)
  at androidx.test.espresso.base.UiControllerImpl.loopUntil (UiControllerImpl.java:7)
  at androidx.test.espresso.base.UiControllerImpl.loopUntil (UiControllerImpl.java:1)
  at androidx.test.espresso.base.UiControllerImpl.injectMotionEvent (UiControllerImpl.java:5)
  at androidx.test.espresso.action.MotionEvents.sendUp (MotionEvents.java:6)
  at androidx.test.espresso.action.MotionEvents.sendUp (MotionEvents.java:1)
  at androidx.test.espresso.action.Tap.sendSingleTap (Tap.java:5)
  at androidx.test.espresso.action.Tap.-$$Nest$smsendSingleTap
  at androidx.test.espresso.action.Tap$1.sendTap (Tap.java:1)
  at androidx.test.espresso.action.GeneralClickAction.perform (GeneralClickAction.java:4)
  at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform (ViewInteraction.java:2)
  at androidx.test.espresso.ViewInteraction.doPerform (ViewInteraction.java:23)
  at androidx.test.espresso.ViewInteraction.-$$Nest$mdoPerform
  at androidx.test.espresso.ViewInteraction$1.call (ViewInteraction.java:6)
  at androidx.test.espresso.ViewInteraction$1.call (ViewInteraction.java:1)
  at java.util.concurrent.FutureTask.run (FutureTask.java:266)
  at android.os.Handler.handleCallback (Handler.java:873)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:193)
  at android.app.ActivityThread.main (ActivityThread.java:6669)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:858)

https://github.com/enioka-Haute-Couture/enioka_scan/assets/24919155/adf44eef-4fb3-4a2b-8aa1-d59cbbae6c38