Make equality checks defensive to null reference

See gh-19540
This commit is contained in:
liuhuan
2020-01-06 14:14:57 +08:00
committed by Stephane Nicoll
parent e87ed08ef4
commit 6d8b849361
4 changed files with 7 additions and 7 deletions

View File

@@ -61,7 +61,7 @@ class RestDocsWebTestClientBuilderCustomizer implements WebTestClientBuilderCust
if (port == null) {
return true;
}
return (scheme.equals("http") && port == 80) || (scheme.equals("https") && port == 443);
return ("http".equals(scheme) && port == 80) || ("https".equals(scheme) && port == 443);
}
}