Skip to content

Commit

Permalink
Handle Monitor#interests = nil
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Feb 2, 2018
1 parent fcd25cb commit 62e6973
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ext/nio4r/monitor.c
Expand Up @@ -163,7 +163,11 @@ static VALUE NIO_Monitor_interests(VALUE self)

static VALUE NIO_Monitor_set_interests(VALUE self, VALUE interests)
{
NIO_Monitor_update_interests(self, NIO_Monitor_symbol2interest(interests));
if(interests == Qnil) {
NIO_Monitor_update_interests(self, 0);
} else {
NIO_Monitor_update_interests(self, NIO_Monitor_symbol2interest(interests));
}

return rb_ivar_get(self, rb_intern("interests"));
}
Expand Down

0 comments on commit 62e6973

Please sign in to comment.