diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-10-01 13:42:58 +1300 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-10-01 16:02:03 +1300 |
commit | 13660105e225df0a4fc1f91b8c9618261e5761f3 (patch) | |
tree | 952edb6842ada12121d4c4fc9f64308f916a5f22 /scheduler.c | |
parent | bc23216e5a4204b8e626704c7277e9edc1708189 (diff) |
Don't call `Scheduler#close` if it doesn't exist.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3612
Diffstat (limited to 'scheduler.c')
-rw-r--r-- | scheduler.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scheduler.c b/scheduler.c index 8ec5039096..f0bb5ee597 100644 --- a/scheduler.c +++ b/scheduler.c @@ -39,7 +39,9 @@ Init_Scheduler(void) VALUE rb_scheduler_close(VALUE scheduler) { - return rb_funcall(scheduler, id_close, 0); + if (rb_respond_to(scheduler, id_close)) { + return rb_funcall(scheduler, id_close, 0); + } } VALUE |