-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix the fix for the fix for MangaUpdates
null is better than a crash
- Loading branch information
1 parent
04538c5
commit 58d5b5b
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58d5b5b
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.
it's not about it being null, it's about the passed value not able to be converted to an Int.
toInt
will throw an exception in that case. I've seen things like5e
or even words passed into it.58d5b5b
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.
a silent voice: empty
deadman wonderland: "57 (end)"
Fullmetal alchemist: "Gaiden"
Steins Gate Mugen Enten: "Oneshot"
Alien 9 Next: "Champion Red Special"
etc etc
58d5b5b
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.
toInt can throw a
NumberFormatException
while toIntOrNull catches the exception and returns null instead