-
Notifications
You must be signed in to change notification settings - Fork 422
Description
-
Description
In ShareDataActivity we checking ifappDir.listFiles() != null
to continue our work. Though in L68 we trying to get the length of our File arrayfileList = new String[files.length]
without even checking if our array is null or not and that can lead to Crash and Runtime exception if array found null, and can lead to poor user experience -
Expected Behavior
If the our CSV dir doesn't exist then no need to call ShareDataActivity, either we can check for the csv file list before calling it inNeuroLab.java
on methodonNavigationItemSelected()
or either to get array length of file after confirming that our array is not null and if found null then show a message to user that our file doesn't exist/no data to share! -
Steps to reproduce it
If our CSV dir is empty or file are null, then ShareDataActivity will crash because of null array -
System Information
Device | Xiaomi Redmi Note 5 Pro/AI (whyred) |
Android version/OS | Android Q (API 29) |
I'll provide a runtime crash screenshot below! I can have a PR over here to fix this!