summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ast.c b/ast.c
index 3fec251bcc..78de316c61 100644
--- a/ast.c
+++ b/ast.c
@@ -710,7 +710,7 @@ ast_node_script_lines(rb_execution_context_t *ec, VALUE self)
struct ASTNodeData *data;
TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
VALUE ret = data->ast->body.script_lines;
- if (!ret) ret = Qnil;
+ if (!RB_TYPE_P(ret, T_ARRAY)) return Qnil;
return ret;
}