Skip to content

Conversation

@alexanderrtaylor
Copy link

@alexanderrtaylor alexanderrtaylor commented Mar 23, 2017

Added a check to make sure that the default IP exists in the container
to make sure that the return is non-null

@reviewbybees

Added a check to make sure that the default IP exists in the container
to make sure that the return is non-null
String route = out.toString("UTF-8").trim();

// ensures that the the default IP exists so that the return is not null
if (route.indexOf("default") == -1){
Copy link
Member

Choose a reason for hiding this comment

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

Would be better to do:

if (!route.contains("default")) {
.....

Copy link
Author

Choose a reason for hiding this comment

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

You are right here, it is more precise and will probably work faster(maybe?).

Change is done

@ghost
Copy link

ghost commented Mar 28, 2017

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

I would prefer a non-Runtime exception, but there is already a runtime one above in the code => the code does not get worse.

🐝

@oleg-nenashev
Copy link
Member

@reviewbybees done

@jonhermansen jonhermansen self-assigned this Feb 18, 2018
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.

5 participants