rparkins999 / CalendarTrigger

Android app to trigger actions on calendar events
GNU General Public License v3.0
13 stars 6 forks source link

[Version 2.0] – Fatal Exception when pressing browse a sound file #8

Closed tobias-g1 closed 6 years ago

tobias-g1 commented 6 years ago

Expected behaviour

When a user indicates that they would like to browse a sound file for after enabling notifications on "event end of action for class X" a user should be presented with a file picker to select a sound. (A user may be presented with a pre-defined list of available sounds from the default Android sounds instead).

Actual behaviour

When a user indicates that they would like to browse a sound file for after enabling notifications on "event end of action for class X" a fatal exception occurs.

How to reproduce

  1. From either a fresh install or pre-installed state select "Create new event class" located within the top navigation bar.
  2. When the create new event class option is presented you can name your class anything. However, for clarity, this should be named "testClass"
  3. Submit the new name, and you will be presented with the ability to select from the different actions that can be configured against a class. Select "Event end action for testClass".
  4. Enable "show a notification"
  5. Click browse for a sound file (The application will crash).

Logs

05-26 22:31:20.652 11789-11789/uk.co.yahoo.p1rpp.calendartrigger E/AndroidRuntime: FATAL EXCEPTION: main
    Process: uk.co.yahoo.p1rpp.calendartrigger, PID: 11789
    java.lang.NullPointerException: Attempt to get length of null array
        at uk.co.yahoo.p1rpp.calendartrigger.activites.l.b(Unknown Source:39)
        at uk.co.yahoo.p1rpp.calendartrigger.activites.FileListView.a(Unknown Source:30)
        at uk.co.yahoo.p1rpp.calendartrigger.activites.j.onViewCreated(Unknown Source:59)
        at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1289)
        at android.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1557)
        at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1618)
        at android.app.BackStackRecord.executeOps(BackStackRecord.java:807)
        at android.app.FragmentManagerImpl.executeOps(FragmentManager.java:2386)
        at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2181)
        at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2136)
        at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2043)
        at android.app.FragmentManagerImpl$1.run(FragmentManager.java:719)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Enviroment

Tested on multiple different Android versions both using a physical device and emulators.

Device Android Version Emulator/Physical Reproducible?
Motorola 3 (3rd Generation) 6.0.1 Physical No
Pixel 2 6.0 Emulated No
Pixel 2 7.1 Emulated Yes
Pixel 2 8.0 Emulated Yes

Recording of the issue

The following video shows the issue in more detail, the video was taken on the 8.0 emulator.

https://www.youtube.com/embed/Gc1EACU_2pI?ecver=2

rparkins999 commented 6 years ago

Fixed in release 2.2 which is now available in both github and f-droid, so I'm closing this one.