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
Conversation
holder.skillRating.rating = stars.averageStar | ||
holder.skillTotalRatings.text = stars.totalStar.toString() | ||
} | ||
} catch (exception: Exception) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never catch generic exception
There was a problem hiding this comment.
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.
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:
|
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:
|
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.