Skip to content

Commit

Permalink
check stream != null before close
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyn committed Feb 17, 2024
1 parent 7765164 commit 5f21c7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
if (hasRemaining(bfl)) {
leftovers = bfl;
} else {
stream.close();
stream = null;
if(stream != null) {
stream.close();
stream = null;
}
}
} else {
complete = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
import java.util.stream.StreamSupport;

import com.google.storage.v2.stub.GrpcStorageCallableFactory;
import com.google.storage.v2.stub.GrpcStorageStub;
import io.grpc.*;
import io.grpc.protobuf.ProtoUtils;
import io.grpc.protobuf.lite.ProtoLiteUtils;
Expand Down

0 comments on commit 5f21c7c

Please sign in to comment.