collect icon indicating copy to clipboard operation
collect copied to clipboard

Multi clicking Delete button in the audio widget and deleting the recorded sound twice crashes the app

Open dbemke opened this issue 1 year ago • 0 comments

ODK Collect version

the store version 2023.3.1, the master version 8d8c5461d4be3d775504eee6e3424fbcb92140f0

Android version

8.1, 10, 13

Device used

Nexus 5X, Redmi 9T, Pixek 6a

Problem description

It possible to mult iclick "Delete" button in the audio widget. When there are two delete dialogs opened clicking "Delete” in the first dialog and "Delete” in the second dialog cause the crash of the app (null pointer exception). Reproducing the issue on the store version took many more tries than on the master version.

FATAL EXCEPTION: main Process: org.odk.collect.android, PID: 23264 java.lang.NullPointerException at java.io.File.<init>(File.java:323) at org.odk.collect.android.formentry.saving.FormSaveViewModel.getAnswerFile(Unknown Source:22) at org.odk.collect.android.widgets.AudioWidget.getAudioFile(Unknown Source:4) at org.odk.collect.android.widgets.AudioWidget.deleteFile(Unknown Source:19) at org.odk.collect.android.widgets.AudioWidget.clearAnswer(Unknown Source:0) at org.odk.collect.android.widgets.AudioWidget$1.lambda$onRemoveClicked$0(Unknown Source:2) at org.odk.collect.android.widgets.AudioWidget$1.$r8$lambda$_mjr20TnP3uLUG9ogKgxG6u3VaM(SourceFile:0) at org.odk.collect.android.widgets.AudioWidget$1$$ExternalSyntheticLambda0.onClick(SourceFile:0) at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(Unknown Source:37) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:226) at android.app.ActivityThread.main(ActivityThread.java:7592) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 2024-01-12 14:11:09.842 750-2073 soundtrigger [email protected] E audio_extn_sound_trigger_update_stream_status: invalid input device 0x0, for event 2

Steps to reproduce the problem

  1. Go to All widgets form to the audio widget.
  2. Record sound.
  3. Click play.
  4. Multi click the Delete button.
  5. In two dialogs that appear click "Delete”.

Expected behavior

Multi clicking shouldn't be allowed.

dbemke avatar Jan 12 '24 13:01 dbemke