summaryrefslogtreecommitdiff
path: root/io_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'io_buffer.c')
-rw-r--r--io_buffer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io_buffer.c b/io_buffer.c
index 524756e041..a97c687239 100644
--- a/io_buffer.c
+++ b/io_buffer.c
@@ -322,6 +322,9 @@ io_buffer_map(int argc, VALUE *argv, VALUE klass)
}
VALUE io = argv[0];
+ if (!RB_TYPE_P(io, T_FILE)) {
+ rb_raise(rb_eArgError, "Must be file/io!");
+ }
size_t size;
if (argc >= 2) {