-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Updated RateOrShareFragment elements to disappear on some config options. #553
base: master
Are you sure you want to change the base?
Conversation
df90d4b
to
3a79070
Compare
) | ||
) | ||
) | ||
return |
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 prefer having no random returns within methods. In both cases you're calling dialog?.setTitle() with a string parameter. Have the if/else statement set that string parameter appropriately, and call dialog?.setTitle(thatStringParameter) at the end of the method.
) | ||
return | ||
} | ||
catch (e: 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.
Instead of catching an Exception and then re-throwing "if it's an NPE" later, why not just catch only NullPointerException and let any other kind of exception get automatically not caught and thrown?
|
||
fun isCustomException(e: Exception) { | ||
when (e) { | ||
is NullPointerException -> { |
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.
To complement the previous comment - basically you've caught any exception and then have logic to check whether it's an NPE and re-throw if it's not. It's significantly simpler to just catch only the NPE instead.
catch (NullPointerException e) { | ||
throw e; | ||
} |
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.
Why are you catching the NPE and then just throwing it? Why not just not catch it in the first place?
catch (NullPointerException e) { | ||
throw e; | ||
} |
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.
Same here, why catch at all?
No description provided.