Skip to content

Commit aba972d

Browse files
Add missing null check
1 parent 83eee2e commit aba972d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageReadChannel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ private static boolean isReopenable(Throwable exs) {
151151
// ensures finite iteration
152152
int maxDepth = 10;
153153
while (throwable != null && maxDepth-- > 0) {
154-
if (throwable.getMessage().contains("Connection closed prematurely")
154+
if ((throwable.getMessage() != null
155+
&& throwable.getMessage().contains("Connection closed prematurely"))
155156
|| throwable instanceof SSLException
156157
|| throwable instanceof EOFException
157158
|| throwable instanceof SocketException

0 commit comments

Comments
 (0)