aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index cd7f0aa07f..cbca404d06 100644
--- a/io.c
+++ b/io.c
@@ -1960,7 +1960,7 @@ rb_io_getline_1(VALUE rs, long limit, VALUE io)
swallow(fptr, '\n');
}
}
- str = io_enc_str(str, fptr);
+ if (!NIL_P(str)) str = io_enc_str(str, fptr);
}
if (!NIL_P(str)) {