NPE prevention for new moves#545
Open
syrusgreycloak wants to merge 2 commits into
Open
Conversation
added 2 commits
February 17, 2017 12:13
…gram load when encountering unrecognized moves.
…gram load when encountering unrecognized moves.
Owner
|
Seems really cool! Will review thoroughly soon. |
ericklucena
approved these changes
Feb 19, 2017
| } else { | ||
| weaveEnergyUsageRatio = (double) Math.abs(pm2.getEnergy()) / (double) pm1.getEnergy(); | ||
| } | ||
| if (pm1 != null && pm2 != null) { |
There was a problem hiding this comment.
Wouldn't a' if ( conditions ) return 0.0;' more simple and legible? Consider this comment on the others validations as well.
Author
There was a problem hiding this comment.
It's a style preference. My employer has strict rules on only one return from a method for code maintenance, so it has snuck its way into my coding.
|
I haven't reviewed the changes in great detail but I've applied the changes and I've been running a couple of days now without any issues so far, fwiw. |
Owner
|
Heya. Can you resolve the current conflicts after the PR adding Gen 2 got merged? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added null checks and default return values so current iteration of program will still start and load known pokemon even if moves are unknown.