We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 935e745 commit 8afacbdCopy full SHA for 8afacbd
ext/java/org/jruby/ext/stringio/StringIO.java
@@ -2201,8 +2201,13 @@ private void checkWritable() {
2201
}
2202
2203
private void checkModifiable() {
2204
- checkFrozen();
2205
- if (getPtr().string.isFrozen()) throw getRuntime().newIOError("not modifiable string");
+ if (getPtr().string == null || getPtr().string.isNil()) {
+ /* Null device StringIO */
2206
+ } else if (getPtr().string.isFrozen()) {
2207
+ throw getRuntime().newIOError("not modifiable string");
2208
+ } else {
2209
+ getPtr().string.modify();
2210
+ }
2211
2212
2213
private void checkInitialized() {
0 commit comments