Skip to content

Commit

Permalink
Never allow null buffer through
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Oct 7, 2023
1 parent 477bcc7 commit 00b5a83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/RubyIOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public static RubyClass createIOBufferClass(Ruby runtime) {
public static final int NETWORK_ENDIAN = BIG_ENDIAN;

public static RubyIOBuffer newBuffer(Ruby runtime, ByteBuffer base, int size, int flags) {
if (base == null) return newBuffer(runtime, size, flags);

return new RubyIOBuffer(runtime, runtime.getIOBuffer(), base, size, flags);
}

Expand Down

0 comments on commit 00b5a83

Please sign in to comment.