aboutsummaryrefslogtreecommitdiff
path: root/android/guava-testlib/src/com/google/common/testing/Platform.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/guava-testlib/src/com/google/common/testing/Platform.java')
-rw-r--r--android/guava-testlib/src/com/google/common/testing/Platform.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/android/guava-testlib/src/com/google/common/testing/Platform.java b/android/guava-testlib/src/com/google/common/testing/Platform.java
index bbad5598d..9726d2de0 100644
--- a/android/guava-testlib/src/com/google/common/testing/Platform.java
+++ b/android/guava-testlib/src/com/google/common/testing/Platform.java
@@ -17,6 +17,7 @@
package com.google.common.testing;
import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
import com.google.common.annotations.GwtCompatible;
import java.io.ByteArrayInputStream;
@@ -42,7 +43,7 @@ final class Platform {
ObjectOutputStream out = new ObjectOutputStream(bytes);
out.writeObject(object);
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
- return (T) in.readObject();
+ return (T) requireNonNull(in.readObject());
} catch (IOException | ClassNotFoundException e) {
throw new RuntimeException(e);
}