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

fix: crash when selecting some categories from skills activity #2116

Merged
merged 3 commits into from May 8, 2019
Merged

Conversation

naman653
Copy link
Member

Fixes #2115 #1705

Reasons of Crash:
Skills are fetched in form of SkillData which defines most of its attributes as non-nullable. But many skills coming from the server stores those attributes values as null which causes Exceptions when different methods are called on them. These exceptions inclued IllegalArgumentException, NullPointerException, IndexOutOfBoundException, etc. This causes the app to crash.

Changes: I've handled the exceptions to avoid the crash.

holder.skillRating.rating = stars.averageStar
holder.skillTotalRatings.text = stars.totalStar.toString()
}
} catch (exception: Exception) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never catch generic exception

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but there are a lot of exceptions happening, so I did that. Well, I will improve that and try to catch each and every exception separately.

@ci-reporter
Copy link

ci-reporter bot commented Mar 31, 2019

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Circle CI build is failing as of 04466af. Here's the output:

spotless check
Parallel execution is an incubating feature.

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


Failed build for 42df3f4
spotless check
Parallel execution is an incubating feature.

This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.

@ci-reporter
Copy link

ci-reporter bot commented Mar 31, 2019

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Circle CI build is failing as of 42df3f4. Here's the output:

spotless check
Parallel execution is an incubating feature.

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.

@iamareebjamal iamareebjamal merged commit 82b8321 into fossasia:development May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App crash on selecting some specific categories from Categories section
3 participants