File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
hibernate-core/src/main/java/org/hibernate/engine/jdbc/proxy Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,9 @@ private BlobProxy(InputStream stream, long length) {
7070 }
7171
7272 private void setStreamMark () {
73- if ( binaryStream .getInputStream ().markSupported () ) {
74- binaryStream .getInputStream ().mark ( markBytes );
73+ final InputStream inputStream = binaryStream .getInputStream ();
74+ if ( inputStream != null && inputStream .markSupported () ) {
75+ inputStream .mark ( markBytes );
7576 resetAllowed = true ;
7677 }
7778 else {
@@ -92,12 +93,14 @@ public BinaryStream getUnderlyingStream() throws SQLException {
9293 private void resetIfNeeded () throws SQLException {
9394 try {
9495 if ( needsReset ) {
95- if ( !resetAllowed ) {
96+ final InputStream inputStream = binaryStream .getInputStream ();
97+ if ( !resetAllowed && inputStream != null ) {
9698 throw new SQLException ( "Underlying stream does not allow reset" );
9799 }
98-
99- binaryStream .getInputStream ().reset ();
100- setStreamMark ();
100+ if ( inputStream != null ) {
101+ inputStream .reset ();
102+ setStreamMark ();
103+ }
101104 }
102105 }
103106 catch ( IOException ioe ) {
You can’t perform that action at this time.
0 commit comments