mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
Fix potential null pointer error
This commit is contained in:
parent
075677e415
commit
ae97c826f7
1 changed files with 2 additions and 2 deletions
|
|
@ -40,12 +40,12 @@ public class JavaVersionTest {
|
|||
@Test
|
||||
public void testJavaVersion() throws Exception {
|
||||
String exp = System.getenv("KOKORO_JAVA_VERSION");
|
||||
// Java 8's version is read as "1.8"
|
||||
if(exp.equals("8")) exp = "1.8";
|
||||
if(exp == null || exp.isEmpty()) {
|
||||
System.err.println("No kokoro java version found, skipping check");
|
||||
return;
|
||||
}
|
||||
// Java 8's version is read as "1.8"
|
||||
if(exp.equals("8")) exp = "1.8";
|
||||
String version = System.getProperty("java.version");
|
||||
assertWithMessage("Expected Java " + exp + " but found Java " + version)
|
||||
.that(version.startsWith(exp))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue