Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: To fix a NullPointerException in ShareDataActivity #650

Open
radcolor opened this issue Jul 21, 2020 · 2 comments
Open

Bug: To fix a NullPointerException in ShareDataActivity #650

radcolor opened this issue Jul 21, 2020 · 2 comments
Labels
hacktoberfest Issue eligible for hacktoberfest

Comments

@radcolor
Copy link

  • Description
    In ShareDataActivity we checking if appDir.listFiles() != null to continue our work. Though in L68 we trying to get the length of our File array fileList = 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 in NeuroLab.java on method onNavigationItemSelected() 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

DeviceXiaomi Redmi Note 5 Pro/AI (whyred)
Android version/OSAndroid Q (API 29)

I'll provide a runtime crash screenshot below! I can have a PR over here to fix this!

Screenshot from 2020-07-21 01-53-06

@jddeep jddeep added the hacktoberfest Issue eligible for hacktoberfest label Oct 3, 2020
@jddeep
Copy link
Member

jddeep commented Oct 3, 2020

Go ahead!

@pratik9315
Copy link

Hello sir, can I work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issue eligible for hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants