Skip to content

NullpointerException resulting in app crash when the device orientation is changed during Mrz scan #9

@SinanSoftware

Description

@SinanSoftware

Cordova SDK versions 5.5 up to 5.7 have issues when the device orientation is changed from landscape to portrait and back multiple times (scan freeze or app crash). In versions 5.5 and 5.6 we notice a scan freeze wherein a document is no longer recognized. In version 5.7 we see a NullpointerException in the logging causing the application to shut down.

Steps to reproduce:

  1. Make sure to enable the android setting for "auto-rotate screen" on your phone
  2. Follow the: "How to build the demo application" readme
  3. Start the app
  4. Choose MRZ
  5. Start 'scan doc' (do not point the camera to a document)
  6. Start rotating the device multiple times (number of rotations to trigger the app crash depends on the phone model. We tested on a Samsung S20)
  7. Witness the app crash

See logging with NullpointerException below:

08-23 16:28:17.890 25143 25143 E AndroidRuntime: Process: com.regula.documentreader, PID: 25143
08-23 16:28:17.890 25143 25143 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'int com.regula.documentreader.api.results.DocumentReaderResults.rfidResult' on a null object reference
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocumentReader.notifyClient(DocumentReader.java:1145)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocumentReader.notifyClient(DocumentReader.java:1131)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.CaptureActivity3.handleCompletion(CaptureActivity3.java:1188)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.CaptureActivity3.onCompleted(CaptureActivity3.java:1005)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecuteNotification(RecognitionTask.java:116)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocReaderAsyncTask.onPostExecute(DocReaderAsyncTask.java:28)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecute(RecognitionTask.java:125)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecute(RecognitionTask.java:14)
08-23 16:28:17.903 3536 3547 W ActivityManager: crash : com.regula.documentreader,0
08-23 16:28:17.906 3536 3547 W ActivityManager: Force finishing activity com.regula.documentreader/.api.CaptureActivity3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions